Games · Chess

Chess

The full game. Four skill levels, the lower three powered by a small alpha-beta engine I shipped with the page, the top one powered by Stockfish loaded into your browser on demand. Pick a side, a clock, and start moving.

Controls

Level
Clock Move 1

Chess board

Your move (white).

Actions

Status

Session record

Beginner 0–0–0
Intermediate 0–0–0
Advanced 0–0–0
Expert 0–0–0

Win–Loss–Draw, per level, kept locally in your browser.

How to play

Moving. Click a piece to select it; legal target squares light up with a green dot (or a green ring for captures). Click a target to move. Drag-and-drop works too — press on a piece, drag to the destination, and release. To deselect, click the same piece again or click an empty square.

Castling. Move the king two squares toward the rook. The rook jumps to its castled square automatically. You can't castle through check, out of check, or after the king or that rook has moved.

En passant. If an opponent's pawn moves two squares from its starting rank and lands beside your pawn, you can capture it on the very next move as if it had only moved one square. Just play the diagonal capture; the page handles the rest.

Promotion. Move a pawn to the back rank and a small picker appears asking which piece you want — Queen, Rook, Bishop, or Knight. The default highlight is Queen; press the one you want.

Check. When a king is in check, its square pulses red. You must get out of check on your next move (block, capture the checking piece, or move the king).

Game endings. A game ends on checkmate (you lose if your king is checkmated, win if the computer's is), stalemate (draw, no legal moves and not in check), the 50-move rule (no pawn move or capture in 50 moves per side), threefold repetition (same position three times), insufficient material (neither side can mate, e.g. king vs. king + knight), agreed draw, resignation, or running out of time when the clock is enabled.

Hint. Asks the engine what it would play in your shoes at the current level, then highlights the recommended piece. It never moves the piece for you.

Undo. Backs up your last move and the computer's reply together — you're returned to the position right before your last decision.

Levels. Beginner / Intermediate / Advanced are an alpha-beta minimax engine at depths 2 / 4 / 6 with piece-square tables for evaluation. Expert switches in Stockfish, the strongest open-source chess engine in the world, loaded into your browser the first time you select Expert (about 1 MB over the wire). If Stockfish fails to load, Expert falls back to a depth-8 search on the built-in engine.

Clocks. None plays untimed. Blitz is 5 minutes per side with no increment. Rapid is 15 minutes per side with 10 seconds added after each move. A side that runs out of time loses (the side with the move loses first); if the other side has insufficient material to mate, the game is drawn.

About this page

The built-in engine is a small alpha-beta minimax search with piece-square-table evaluation, basic mobility and king-safety terms, and a short quiescence search at the leaf so tactical positions don't get evaluated mid-capture. It runs in a Web Worker so the UI stays responsive while the computer thinks. At Expert level, the search is handed off to Stockfish — the open-source chess engine that's been at or near the top of every public computer-chess rating list for years. Stockfish is GPLv3; its source is at github.com/official-stockfish/Stockfish.

Nothing leaves your browser. The game, your move history, and your win/loss/draw record stay local. Per-level stats are kept in your browser's localStorage; clearing site data resets them. No accounts, no leaderboards, no telemetry beyond the site-wide page-view counter.