Convert your locally compiled binary to a C++ code/text format that you can use on Codingame.com
Flagged as a cheat during contests since Wondev Woman
- Converts the binary to base85 text encoding
- Outputs a .cpp file with code to recreate the binary file on the CG servers and run it
- Compile this tool
- Compile your AI as a linux binary
- Run this tool on the linux binary (e.g: Binary_To_Base85 MyBinary)
- Optionally pass a third argument, a source code file to be appended as a comment (e.g: Binary_To_Base85 MyBinary MySource.cpp)
- Use the "_Base85.cpp" file as your program on Codingame
- If you compile your AI with a different version of the compiler to what CG is using the binary may not run due to looking for a non-existing version of the runtime libraries
- Strip the binary
- Compress it with UPX
before using this tool, to reduce the chance of hitting the 100ko code size limit of Codingame.
The included Base85.sh shell script is meant as an example of using this tool. It will not work on your machine if your not on linux, your PATH is not correct and/or you have not installed UPX.
- Original idea is from [CPC]rOut on Codingame.com