AYOUB.*[ARCADE]

Chess Tactics

Puzzle—
Goal—
Solved0
Streak0
Best0

ENGINE SPECIFICATION // ARCHITECTURAL GUIDE

How to play Chess Tactics

Controls for Chess Tactics
KeysAction
Click / DragMove piece
HHint
RReset
← →Prev / Next
FFlip board
MMute

On phones and tablets, use the on-screen tactile D-pad under the viewport.

About Chess Tactics

Chess Tactics is a checkmate puzzle trainer with 4,462 positions: 307 mate-in-one, 3,412 mate-in-two and 743 mate-in-three. Each one asks you to find the forced mate for the side to move. You move by clicking or dragging pieces, and the opponent's replies are played automatically from the solution line.

Only the solution move counts. Any other legal move is rejected and counts as a miss. The board flips when Black is to move, a pawn reaching the last rank opens a promotion picker, and the Goal label shows M1, M2 or M3.

Scoring, levels and tips

  • Every finished puzzle adds one to your solved count.
  • Your streak grows only on clean solves, with no wrong moves and no hints. One miss or one hint resets it; your best streak is kept.
  • Hints come in two steps: the first highlights the piece to move, the second also shows its target square.
  • Puzzles run shortest first: all mate-in-one, then mate-in-two, then mate-in-three. ← and → step through them, and after a solve you can jump to a random one.
  • Your solved count, best streak and current puzzle are saved in your browser, so you resume where you left off.
  • Tip: selecting a piece marks every square it can legally reach, so check a candidate move before you commit your streak to it.
  • Tip: in longer mates, the defender's automatic reply is highlighted as the last move. Read it before you play on.

How it's built

Everything runs in the browser, written from scratch in TypeScript with a canvas-drawn board and no chess library. A compact 0x88 move generator produces fully legal moves, including castling, en passant and promotion, and detects check, checkmate and stalemate. It doesn't search or evaluate positions, because the solutions come from the puzzle data.

The puzzles started as an 851 KB JSON file. A build script packs them into a custom binary format, with two board squares per byte, fields stored column by column so similar bytes sit together, and records sorted by length and position, then gzips it to about 77 KB. The browser inflates it with the native DecompressionStream API, and the build script verifies that every puzzle decodes exactly.