/ 04 — Games

PythonChess

A full chess game in Python with a Pygame GUI — complete rule enforcement, move highlighting, and check/checkmate detection.

Role
Solo Developer
Timeframe
2025
Status
Shipped
[ pythonchess · board ]
PythonPygame
01 / Problem

Implementing chess properly forces you to encode every rule precisely — legal moves per piece, turn order, and the recursive question of whether a move leaves your own king in check.

02 / Approach

I modelled the board and pieces explicitly, generated valid moves per piece type, and layered check/checkmate detection on top of game-state tracking, with a Pygame GUI that highlights selections and legal targets.

03 / What I built

Rules engine

Standard movement for every piece, turn-based play, and game-state tracking.

Check & checkmate detection

Validates that moves don’t leave the king in check and detects terminal positions.

Interactive board

A Pygame UI that highlights the selected piece and its valid moves and shows game status.

04 / Outcome
Full rules
every piece, legal moves
Check / mate
detection built in
05 / Learnings

A clear separation between game state and rendering kept the rule logic testable. Chess is a great forcing function for thinking about edge cases you’d otherwise skip.