Minimax Chess Bot and GUI

 GitHub - Python Version GitHub - C++ Version

About

This is my implementation of a single-player chess game using the minimax algorithm (which is an algorithm that can be used to generate optimal solutions for a zero-sum two player game) with alpha-beta pruning. A GUI was also written to make use of the bot and provide a single-player chess game experience.

There were two separate implementations that I did.

Python Version

  • This was the one I completed first and represents all the data in an object-oriented fashion.
  • Contains a cross-platform GUI built using pygame.

C++ Version

  • A complete re-implementation to have faster running time than the preceding version. Written in a procedural fashion.
  • Written in GCC (ported to Windows as MinGW)
  • The UI was built using the native Win32 API and as such, is not cross-platform. The algorithmic part was written independently of the UI leaving open the possibility of other GUIs.

Personal Notes

This was one of my cooler projects and one I’m quite proud of to date. It does seem a lot more trivial now than it did then to make this, but I suppose that’s a sign of growth.

I can’t count the number of people I’ve recommended this project to as something to get their foot into writing some actual code. And one video that I send to them all is this explanation of the minimax algorithm by Sebastian Lague. The channel is one I’m subscribed to till date and one that I’d definitely recommend you check out too.