Selfplay Chess

Play chess against a small engine that taught itself by playing itself. Pick one of four levels, or watch it learn from scratch.

Click or tap one of your pieces, then a highlighted square. Arrow keys move around the board and Enter picks a square. The engine searches in a background thread, so the page stays responsive.

Level

You play

After each move the engine shows its evaluation (in pawns, from White's view), search depth, node count and principal variation.

Moves

    Watch it learn

    The engine below starts from scratch, with every piece worth the same, and plays itself. After each game it nudges the values toward whatever predicted the result better. Within a few hundred games it works out that a queen beats a rook, a rook beats a bishop, and so on, without ever being told.

    Starting…

    Piece values so far, pawn = 10 of 1000 games

    Results
    –
    Raw weights
    P 1.000 N 1.000 B 1.000 R 1.000 Q 1.000
    Last game
    –

    Each game uses the same TD-Leaf(λ) rule as learn.py: a 1-ply search plus captures, 10% random moves, and an update after every game. The bars divide by the pawn’s weight, which shrinks during training, so they can jump around even when the order holds. Each run uses a new random seed, so your numbers will differ from mine; the shipped values are 2.79 / 3.34 / 4.21 / 7.37.