- gcc (>=5.4) / clang (>=3.8)
- cmake (>=2.8)
$ git clone [email protected]:shared/reversi_sample_cpp.git
$ cd reversi_sample_cpp
$ mkdir build
$ cd build
$ cmake ..
$ make -j 4
$ cmake .. -DCMAKE_BUILD_TYPE=Debug
- The assertions are enabled.
- The compiled executable file contains debug symbols.
$ cmake .. -DCMAKE_BUILD_TYPE=Release
- The assertions are disabled.
- The compiled program runs fast.
$ ./reversi BLACK_PLAYER_TYPE WHITE_PLAYER_TYPE
For example
$ ./reversi human sample
Please type
$ ./reversi --help
for more information.
$ git remote set-url origin {URL of your repository}
$ git push -u origin master
After you edit the source codes,
$ git add {editted files}
$ git commit
$ git push
If you create a new .cpp
file, you should edit the CMakeLists.txt
.
You can format your source code with clang-format
.
$ cp .clang-format.sample .clang-format
$ clang-format -i *.cpp *.hpp player/*.cpp player/*.hpp
You can change the formatting rules by edditing the .clang-format
.