Category Archives: Programmatic Chess

Programmatic Chess Analysis: Determining if a Player Can Castle or Not

It all started a few years ago when I got the idea of programmatically analyzing a chess position using the Stockfish chess engine to measure position “risk” or “sharpness”. In order to do that I needed a utility function to … Continue reading

Posted in Programmatic Chess | Leave a comment

Programmatic Chess Analysis: Determining if the King is in Check

It all started a few years ago when I got the idea of programmatically analyzing a chess position using the Stockfish chess engine to measure position “risk” or “sharpness”. In order to do that I needed a utility function to … Continue reading

Posted in Programmatic Chess | Leave a comment

Computing a Measure of the Overall Sharpness of a Chess Game Using Stockfish

I’ve been looking at evaluating chess positions using the Stockfish chess engine. I decided to write some code that computes the overall sharpness of a complete chess game. Assuming the existence of a function that computes the sharpness of a … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Multiple PGN Files to FEN Files

I’ve been working on a Python language tool to programmatically convert a chess game file stored in PGN format to a file of FEN strings. For example, if a PGN file amateur_expert_issaquah_2024.pgn is: [Event “Fake Event”] [Site “Issaquah, WA”] [Date … Continue reading

Posted in Programmatic Chess | Leave a comment

Computing a Measure of the Sharpness of a Chess Position Using Stockfish

One morning before work, I decided to write some code to compute a metric that measures the “sharpness” of a particular chess position. Briefly: I use the Stockfish chess engine to determine the current evaluation of the position, and then … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Chess PGN to FEN – Parsing a PGN Move

I’ve been working on a non-trivial Python language software tool to covert a chess game file stored in PGN notation to a file of FEN strings See the post at https://jamesmccaffreyblog.com/2024/05/15/programmatically-converting-chess-pgn-to-fen/ for an explanation of the problem. The code for … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Chess PGN to FEN – Program Organization

I’ve been working on a non-trivial Python language software tool to covert a chess game file stored in PGN notation to a file of FEN strings See the post at https://jamesmccaffreyblog.com/2024/05/15/programmatically-converting-chess-pgn-to-fen/ for an explanation of the problem. The code is … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Chess PGN to FEN – A MoveAnalysisResults Class

I’ve been working on a non-trivial Python language software tool to covert a chess game file stored in PGN notation to a file of FEN strings See the post at https://jamesmccaffreyblog.com/2024/05/15/programmatically-converting-chess-pgn-to-fen/ for an explanation of the problem. The code is … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Chess PGN to FEN – Representing the Board

I’ve been working on a non-trivial Python language software tool to covert a chess game file stored in PGN notation to a file of FEN strings See the post at https://jamesmccaffreyblog.com/2024/05/15/programmatically-converting-chess-pgn-to-fen/ for an explanation of the problem. The code is … Continue reading

Posted in Programmatic Chess | Leave a comment

Converting Chess PGN to FEN – A Game State Class

I’ve been working on a non-trivial Python language software tool to covert a chess game file stored in PGN notation to a file of FEN strings See the post at https://jamesmccaffreyblog.com/2024/05/15/programmatically-converting-chess-pgn-to-fen/ for an explanation of the problem. The code is … Continue reading

Posted in Programmatic Chess | Leave a comment