Anarchy Chess Engine

Winter 2023 - Present

Note: This project is still in progress. Currently, all of the core engine logic is implemented, but there is no user interface to allow for playing the game and the Chess pieces have not been added yet. I expect to finish these features in the next 2 weeks.

A link to the GitHub repository containing all of the code and more information on how it is designed is linked at the bottom of this page.

What is it?

For those unfamiliar, Anarchy Chess is a subreddit for Chess memes. Recently, it has become famous for its creation of various made-up Chess rules that everyone on the subreddit pretends are real. A list of all of these moves can be found on the Anarchy Chess Wiki, though note that new rules are added extremely frequently.

The purpose of this engine is to implement Chess with support for all of the special Anarchy Chess rules. Special care needed to be taken when designing this engine, however, as the Anarchy Chess subreddit frequently adds new rules, which this engine will need to support with as few modifications as possible.

What technical skills does this project showcase?

The aim of this project is to showcase proper C++ software design practices whenever possible. When working on this project, I took care to create everything in the most "correct" way I know of.

Some proper practices I focused on include:

  • Modular design with minimal overlap between modules

    • See the GitHub repository (linked below) for a description of each module

  • Separation between interface and implementation

    • Function declarations are in ".h" files while definitions are in ".cpp" files

  • Test-driven development

    • For each module, I began by writing out the interface in the ".h" file, then I wrote the tests for each function in a separate testing file (using Doctest), then I finally implemented each of the functions in the ".cpp" files.

  • Proper style

    • Maintained consistent style

    • Commented code

  • Standardized build process (CMake)

Some C++ features this project showcases include:

  • Classes

    • private member variables, public functions

    • Inheritance

    • Virtual functions

  • STL data structures

    • std::pair

    • std::vector

    • std::unordered_map

    • std::set

  • Memory management

  • Pointers

    • Function pointers

  • References

    • const references too, of course

Note that I learned C before C++, so in some circumstances, I may gravitate towards C features I am more familiar with over the more modern C++ solutions.


GitHub Repository

  • All code for this project is publically available to read here!

  • There is also a full description of each module in the README