Welcome to the Room of Spirit and Time! In this place, you can efficiently train yourself in problem-solving. We have automated many tiresome and trivial tasks you might face while solving algorithm problems, such as creating a main function, including libraries, compiling, testing, etc. This repository is especially helpful if you work with C++ (or Java) and use Vim (or Neovim) as your editor.
brew install wget
sudo apt-get install -y wget, xdg-utils
sudo apt-get install -y wget, xdg-utils
export BROWSER="powershell.exe /C start"
Run the following commands in your terminal:
git clone https://github.com/monkeyKing001/Algorithm_exercise.git
cd Algorithm_exercise
source setting.shsetting.shwill
- Export and source alias
gogo. - Download cpp, java, Makefile README.md templates.
- edit
autocmdin .vimrc file
$> gogoRun the training program by typing gogo in any directory you’re working in. This command will move you to the Algorithm_exercise directory and start the training program. After running the command, you will see instructions in the terminal.
When prompted, enter your username and project name as directed. If you’re a new user, the program will create a new directory for you. After completing the prompts, the program will:
Create the appropriate directory structure. Generate template files for C++, Java, and Makefiles. Open the problem's URL in your browser. Enjoy solving your algorithm problems!
Once you start a problem, a Makefile will be created in your problem directory. The Makefile includes rules for compiling, running, testing, and cleaning up binary files. You can execute these tasks with simple commands.
make: Compile the source file (e.g., .cpp) and create the binary a.out.make run: Run the compiled binary (./a.out).make test t=<test_num>: Run the binary with a test input file.
Place the test input file (e.g., 1.txt) in the ./test directory before running this command.
Example:
make test t=1
this make command means you are going to compile your solution source code and test with 1.txt.
make java: make the bin fileMain.classmake javarun: run bin filejava Mainmake javatest t=<test_num>: run bin file with test txt input file.
Just prepare the test txt file in ./test directory before run the test.
Example:
make javatest t=1
this make command means you are going to compile your solution java source code and test with 1.txt.
