Tip
This is a modern C++23 implementation of the Gomoku (aka "Five-in-a-Row") game (also known as "Renju", or in the eastern countries, "Crosses and Naughts") featuring an intelligent AI opponent that leans on the MiniMax algorithm with Alpha-Beta pruning, and advanced parallel processing.
Caution
To build this project requires C++23 compatible compiler, such as gcc-11 (the earliest version supporting C++23 features), but recommended at least gcc-15. For clang compiler, you need Clang-16 as a likely minimum, but Clang-17 is preferred). You can use either make or cmake to build the project.
- This project has been developed on MacOS, and builds/compiles on both Apple M-series and Intel prrocessors.
- Linux support will be added in a short future.
There are additional markdown files describing various components. Click on the approprite link to get more details, wherever the link is available.
This project builds four execuable binaries:
Core Executables:
bin/gomoku- is the interactive ANSI Terminal game "Gomoku" where you can play against the computer, or computer can play against itself, or human vs human. There are many CLI flags that control various features and difficulty of the game. Many more details are available in the GOMOKU.md file.bin/gomoku-httpd- is the HTTP server, that (by the default) listens on port 5500, and provides a multi-threaded process that is capable of responding to several endpoints, including the/ai/v1/moveend point, which receives a board in a particular state and returns the same board with the next move placed on it. It's meant to be used by the stateful web or mobile clients.
Test Executables:
bin/test-gomokuis the set of unit tests for the game classes, written using the GoogleTest librarybin/test-gomoku-httpdis the unit tests for thegomoku-httpdservice.
Note
This is an enhanced C++23 version based on the original C implementation at github.com/kigster/gomoku-ansi-c. This version includes significant additional features including computer vs computer gameplay, parallel AI processing, and modern C++23 language features. This project was produced in colaboration with Claude-4-MAX, but the the original evaluation function was written by the author. Also, when we say "playing with AI" we do not mean LLMs, we simply mean you are playing against the computer.
# Build the game
make build -j 4
# Clean build files if needed
make clean# Build using CMake (creates build directory and runs cmake ..)
make cmake-build
# Run tests using CMake
make cmake-test
# Clean CMake build directory
make cmake-clean
# Rebuild from scratch
make cmake-rebuildThis project is © Konstantin Gredeskoul, 2025. It is open source and can be distributed under the MIT License.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests:
https://github.com/kigster/gomoku-cpp23/issues
- Original C Implementation: Based on github.com/kigster/gomoku-ansi-c — single threaded ANSI Terminal game.
- Pattern Recognition: Algorithms adapted from traditional Gomoku AI techniques
- Google Test Framework: For comprehensive C++ testing infrastructure
- Modern C++23: Leveraging latest language features for safety and performance
- Claude-4-MAX: AI pair programming assistant for the C++23 modernization
- Thread Pool Design: High-performance concurrent processing implementation (author unknown)
- v3.0.0: HTTPD.md file describing features of the
httpdserver - v2.0.2: CPP23.md file describing C++23 features used and a fix to cursor directions
- v2.0.0: Modern C++23 implementation with parallel processing and computer vs computer gameplay
- v1.x.x: Original C implementation (see github.com/kigster/gomoku-ansi-c)
