A judge server to run epic PvP coding matches!
The server receives matches via POST requests containing a judge file and two player's source codes, named judge.cpp, player1.cpp, and player2.cpp.
Users can then get the match results and the game log via GET requests. Note that the server will remove the results once the requests are finished.
Currently, the server only supports .cpp files; there will be support for Python files in the future.
Step 1: Pull the image hoanggiapvuvhg/cpp-pvp-judge from Dockerhub. On Ubuntu:
sudo docker pull hoanggiapvuvhg/cpp-pvp-judge
Step 2: Run the server:
sudo docker run -p ${whatever-port-you-want}:9000 hoanggiapvuvhg/cpp-pvp-judge
Step 3: Send a POST request with the files!
Sample request with postman:
You will get a submission ID from the response:
Step 4: Get the match's result
Get on the browser and enter the following links.
http://127.0.0.1:${whatever-port-you-want}/log/{submission-ID}
http://127.0.0.1:${whatever-port-you-want}/results/{submission-ID}