Still wondering why the language that runs the world is missing from this grand competition?
Now's probably the right time to stop wondering, (>.<)
Requires a compatible c++ compiler. One that supports c++20 is a plus.
This code uses single header libraries HTTPServer and JSON parser (Credit to their writers for these high quality libraries).
They need to be downloaded from their respective github repository as explained below. They were removed from direction inclusion due to their quite large size.
If curl is installed, simply run
setup.bat
chmod +x ./setup.sh
setup.sh
In case, curling isn't the way you want to do, simply download both headers :
https://github.com/yhirose/cpp-httplib/blob/master/httplib.h
https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp
and place both header files inside folder 'include' inside this directory
The structure of cpp folder will then be like this :
include\
src\
setup.bat
setup.sh
Readme.md
From inside this directory,
compile both files together and simply run the executable.
g++/clang++ ./src/main.cpp ./src/bot.cpp -ofast -std=c++17 -march=native -lws2_32 -o game
game.exe
g++/clang++ ./src/main.cpp ./src/bot.cpp -ofast -std=c++17 -march=native -pthread -o game
./game
Info : This isn't thorougly tested. Feel free to report issues, bugs or unintended behaviors. If you have trouble with docker submission or face performance regression, remove -march-native from the compiler flag inside dockerfile.