Strategic Chess Battle Simulation (2D)
Two minimax/alpha-beta AIs play a full legal game of chess on a live 2D board — tune search depth, move speed and an aggression/mobility weight and watch material balance, evaluation score and node count swing as the game unfolds.
The 3D version of this sim shows chess pieces gliding through a scripted, looping demo sequence — no rules, no decisions, the same six "moves" repeating forever. This 2D companion replaces that decoration with an actual chess engine: legal move generation for every piece (pawns, knights, bishops, rooks, queens, kings), full check-legality filtering so a side can never move into check, and minimax search with alpha-beta pruning driving both sides of the board. Adjust the search depth, move speed and an aggression weight that trades material safety for mobility and central control, then watch the live material balance, evaluation score and search-node count update move by move until checkmate or stalemate ends the game and a new one begins.
Two minimax/alpha-beta AIs play a full legal game of chess on a live 2D board — tune search depth, move speed and an aggression/mobility weight and watch material and evaluation swing in real time.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Yes for move legality (including not leaving your own king in check) and piece movement rules, with two simplifications: no castling or en passant, and pawns always promote to a queen. Checkmate and stalemate both end the game.
It scales two terms in the evaluation function used by the search: a bonus for controlling the four central squares and a bonus for having more legal moves than the opponent. Higher values make the AI favour active, mobile positions over pure material count.
When several top moves score within a small margin of each other, the engine picks randomly among them instead of always taking the single best line — this keeps successive games varied instead of repeating the same script.