Code Validator for cpp code that tests the code for given input and delivers final verdict|| Written in Go for high speed performance
- Currently only tested for Linux
Testing:
- Navigate to Executables directory [
cd Executables
] - Make sure both executables namely : -code_runner and judge_backend have been given executing priviliges [run
chmod +x {filename}
] - Feel free to modify input.txt and judge.txt according to your needs.
- Open Terminal and run ./judge_backend
- Now navigate to the directory in which you have your cpp file eg. test.cpp
- Hit a Post Request to judge with curl or any other tool along with your cpp file
eg.
curl -X POST -F "code=/test.cpp" http://localhost:8080/judge/backend
- You will get a verdict as a response to your POST request
Development:
Directory - Checker is responsible for generating an application to check code.cpp file with input output requirements. Directory - judge is responsible for generating an application to listen to POST requests and run the file in a temporary directory
- Navigate to whichever directory you would like to experiment with.
- Run :
go mod tidy
- To build the executable run go build
- Make sure app has sufficient priviliges chmod +x {executable_name}
- Run the executable with
./{exe.._name}
in Terminal. Make sure that judge_backend has checker executable to actually check the provided code.
Further Improvements: -Dockerise the code.cpp with checker to generate verdict -Speed improvements -Actual Deployment