This is a great bash script that makes writing competitive programming code easier
Only works for c++
Confirmed to work on Mac and Linux Requires programs to use file io for running
- You can run the script with
bash pathToFile
or
sh pathToFile
- You can make it easier to run by making it an executable
- First you are prompted to enter the global path
- You should use the absolute file path. It should start with /
- To find the absolute file path you can do:
example:readlink -f (relativePath)
readlink -f ex.cpp
- Next you enter your sample input (leave an empty line at the end)
- Then you enter your sample output (leave an empty line at the end)
- You can run any normal terminal commands in this script
- There are a few special commands that you can only do in the script
- run
- exit
- new
- This runs the program against the sample test case and shows the output if wrong
- This allows you to create a new sample test case for your program to run against
- This exits you from the script
Hope you enjoy this script and you do well in your practice and competitions