top of page

Chess Sim

Prototype Goal: To simulate the moves of an entire game of chess using Portable Game Notations (PGNs).

This was posed as a contract between myself and a client. The requirements were to read PGNs (an encoded list of all moves recorded) from chess games previously played in the real world, and to simulate these moves virtually. This included checking moves for their legality, capturing pieces from the board, and  implementing advanced chess techniques like pawn promotion, en passant, and castling. I ended up finishing the contract over a two day period.

The toughest part was creating a system for an abstract 'Chess Piece' class that implemented behaviors common to all pieces like moving and capturing, and having each specific piece inherit and define their own behavior for their specific movement (rooks move linearly, bishops diagonally).

The game logic for interpreting the JSON-converted PGNs, taking turns for each side, and checking the legality of each move according the state of the board, was also tenuous to implement. Here's the script: BoardMaster

I always like to stress test my games at the tail end of their development, so I amped it up to 900 fps while it played all 81 games from Geneva 2017 tournament

bottom of page