Skip to content

Chess / Tic-Tac-Toe Engine — Notes#

Functional#

  • Represent board + pieces.
  • Validate moves (legal, in-check rules).
  • Detect end states: checkmate/stalemate/draw.
  • Optional AI player.
  • Networked play.

Patterns#

  • Strategy (Player AI/Human).
  • State (GameStatus).
  • Command (Move + undo stack).
  • Visitor (per-piece legal moves).

Trade-offs#

  • Bitboard representation (64-bit) for chess scales to engine performance.
  • Per-piece subclass is OO-clean but slower than bitboards.
  • Rule engine centralizes special moves (castling, en passant, promotion).

Refs#

  • "Programming a Chess Engine" classic tutorials; Stockfish source.