TerminalCPH is a terminal-based competitive programming helper that allows you to receive test cases and run them against your compiled programs. It provides a simple interface for managing test cases and running your solutions.
- Web server to receive test cases from competitive programming platforms
- Terminal-based interface for managing test cases
- Support for compiling and running C++ programs
- Test case management with multiple problem support
- Interactive command-line interface
- Rust (latest stable version)
- C++ compiler (clang++ recommended)
- Tokio runtime
- Clone the repository:
git clone https://github.com/yourusername/TerminalCPH.git
cd TerminalCPH- Build the project:
cargo build --releasecopy the executable into your directory of competitve programming files or just make it findable by the path
-
The server will start on
0.0.0.0:10043by default. -
Download the competitive companion extension to a browser
-
Available commands:
help- Show available commandsexit- Exit the programcmp <program_name>- Compile a C++ programlist- List all current test casesrun- Run the program with test casesswitch <problem_id>- Switch to a different problemother- Run the program with custom input
- Compile your program:
cmp solution.cpp
-
When test cases are received, they will be automatically stored and displayed.
-
Run your program against the test cases:
run
- Switch between different problems:
switch 1
The following constants can be modified in src/main.rs:
PORT: Server port (default: 10043)IP: Server IP (default: "0.0.0.0")COMPILATION_COMMAND: C++ compilation command (default: "clang++ -Wall -g -O3 -std=c++20")
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.