A chess engine and AI opponent built from scratch in C++17 with minimax search, alpha-beta pruning, quiescence search, and an SDL2 graphical interface.
A ground-up chess engine and AI opponent in modern C++17. The engine handles every rule — castling, en passant, pawn promotion, check/checkmate/stalemate — with an efficient board representation and legal move generation system.
The AI uses minimax search with alpha-beta pruning to explore game trees, extended by quiescence search to resolve capture sequences and avoid tactical blunders. A killer move heuristic speeds up pruning by remembering moves that caused cutoffs. Positional evaluation includes king safety, pawn structure analysis, bishop pair bonuses, and piece-square tables.
The SDL2 graphical interface features click-to-move interaction, move highlighting, an undo button, a promotion dialog, a live scoreboard tracking wins/losses/draws across games, and a status panel showing real-time game messages. The entire application is compiled to WebAssembly via Emscripten, making it playable directly in the browser with no install required.
emscripten_set_main_loop_arg, bundled assets with --preload-file, and replaced system fonts with embedded TTF files.Want to see more of my work?
All Projects