Skip to content

xboard/mcts_zuniq

Repository files navigation

Zuniq

My submission to CodeCup 2021. Ranked 15º among 57 contestants.

C++17 CMake License

Setting up the build

Dependencies:

  • g++ 7.5+ or clang++ 3.8+
  • CMake 3.16+

The test suite uses Catch v2.13 but it is already included in the lib directory.

After cloning this repository (or uncompressing a release), go to the source code diretory and write:

mkdir -p build
cd build/
cmake -DCMAKE_BUILD_TYPE=Release  -DCMAKE_CXX_FLAGS="-DQUIET_MODE=1" ..
make

To suggest a specific compiler you can write:

CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release  -DCMAKE_CXX_FLAGS="-DQUIET_MODE=1" ..

To test your build execute:

ctest

in directory build/

Playing

Playing as black

Click here to learn the rules of Zuniq and how to comunicate with zuniq engine.

Code Structure

There are two main CMake executable targets:

  • zuniq runs the game engine.
  • zuniq_tests or all_tests runs Catch2 tests.

All engine internal data structures and algorithms are in file zuniq.hpp with some monte carlo tree search configuration parameters in file config.hpp. File main.cpp is just a driver to run the engine and tests_runner.cpp is a driver for test cases in tests.cpp.

The competition has a technical restriction that submissions must be in a single file, and thats what the python script generate_submission_file.py does, generating the file main_submit.cpp to be submitted.

Just for convenience during the competition there is a compile.sh that runs the single file generation script and build (using competition C++ build flag parameters) to an a.out executable (which is as similar as possible to the zuniq executable generated by CMake).

Script static-analysis.sh is used by Travis CI .travis.yaml file.

Zuniq API and simple app

Boris_de_Wilde's API and web app to play against this (or other) engine in a web interface.

Monte Carlo Tree Search references