This is a script to compile with g++ and run C++ files for Competitive Programming with recommendable flags. It compiles files if it's modified after its latest compilation.
Run the following commands in the Terminal.
git clone https://github.com/Wh4rp/CP-Script.git cd CP-Script sudo ./install.sh
Otherwise, you can copy script without the line 48 in your
To run the program, for example the file
HelloWorld.cpp, use the following command in the Terminal.
HelloWorld hasn't been compiled before, it will be compiled to
~/.cache. Then the program will run.
It also accepts input and output files with the follows format:
CP HelloWorld.cpp in.txt out.txt
-f: forces the compilation.
-d: uses the input and ouput files defined on lines 6 and 7. By default, these files are
./out.txt(in the current directory).
CP -fd HelloWorld.cpp
Executable files go to the
cache_path defined in line 5. By default the cache path is
- Add illustrative gifs of script on README to explain better how the program works.
- Add a Help option.
- Add a Edit default input and output files option.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.