C++ library for AI bot programming.
- Specify game rules by subclassing
State
andMove
. - Choose AI algorithm (
Minimax
,MonteCarloTreeSearch
), play by yourself (Human
) or against external program (Executable
). - Read the game state, pass it to the algorithm and output the move. For local, statistically significant tests, use
Tester
.
- Tic Tac Toe - game rules, code example.
- Isola - game rules, code example.
- Connect Four - game rules, code example.
- Go - game rules, code example.
- NegaScout with iterative deepening and transposition table.
- Monte Carlo tree search with UCT and virtual visits.
Both handle sequential, multiplayer games:
MCTS also handles simultaneous games using SUCT.
Execute below commands in the cpp
directory.
make
builds everything.make test
runs unit tests.make valgrind
runs valgrind's memory leak tests.make play_isola
plays as many games as needed to determine which Isola bot is better.
For all the commands check Makefile
file.
- To build and run unit tests,
g++
andlibboost-all-dev
packages are needed. - To run valgrind,
valgrind
package is needed. - To make GIFs,
imagemagick
package is needed.
You can install all of them with sudo apt-get install g++ libboost-all-dev valgrind imagemagick
.
- Correctness.
- Compliance with environment typical for competitions. One process. One file submission, compiled with one invocation of
g++
. - Performance.
Suggestions welcome on Issues. Pull requests too.
If you use code or ideas from this repository, please cite it as follows:
@misc{stelmaszczyk2015gtsa,
author = {Stelmaszczyk, Adam},
title = {Game Tree Search Algorithms},
year = {2015},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/AdamStelmaszczyk/gtsa}},
}