Art STEM

Custom Chess Board Setup for Sim and Puzzles

In addition to solving real-life and abstract challenges, I love playing chess and mulling over different scenarios. When I don’t want to play the entire game from beginning to end, but rather start at a climactic stage, it makes it even more exciting and challenging to play it to the end with someone or even by myself simulating different scenarios. However, manually setting up and resetting the board each time is a chore. That’s why I created this software solution, which allows me to easily set up the board, consider different moves, and reset it without a mess.

The app is quite straightforward and very purposely so. My objective was to create a way to quickly “draw” and “redraw” a board at any desired stage of the game. I wanted a digital canvas with a chess board (with light and dark colored squared that’s fully customizable to any color combinations), and have all the pieces from white and black sides outside of the board initially.

Then I just want to drag and drop any of the pieces to arrange the board layout to set up a critical moment of the game, after which, I can simulate different outcomes with different moves. Also, once the layout is set up, I can take a digital snapshot of the board and replay it as many times as I want to with different moves and outcomes (reusability). This is a big time-saver for me and also great for capturing different learnings with trial and error.

This is how the interface and setting up a custom layout works using the mouse:


The initial canvas looks as below where it’s a blank board with pieces outside of the board. The rows and columns are lettered and numbered as per standard for ease of referencing any square and piece.

A full start of a chess game setup board using all the pieces from both sides can also be simply configured by dragging and dropping, which would look like this:


Any custom configuration can be laid out such as the one below (where we only use a subset of all the pieces from each side):


The screenshot can be taken using PrintScreen or any screen capture tool. The code does not have any game logic.

If you’d like to get the full source code to this (Python), you can download it from my Patreon site.

For daily chess puzzles and challenges, check out my post at https://flyingsalmon.net/daily-chess-puzzle/ It offers fresh, fascinating puzzles from the troves of chesspuzzle.net, including puzzles from chess masters and actual historic championship moments. You can try to solve the puzzles yourself, or get the solution if you give up. The site is free.

If you’d like to learn how to play Chess, I recommend starting here: https://www.chess.com/learn-how-to-play-chess (not affiliated in any way).

Enjoy your games and happy coding (if you’ve downloaded the source code)!


Back To Top