Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TerminalCPH

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.

Features

  • 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

Prerequisites

  • Rust (latest stable version)
  • C++ compiler (clang++ recommended)
  • Tokio runtime

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/TerminalCPH.git
cd TerminalCPH
  1. Build the project:
cargo build --release

copy the executable into your directory of competitve programming files or just make it findable by the path

  1. The server will start on 0.0.0.0:10043 by default.

  2. Download the competitive companion extension to a browser

  3. Available commands:

  • help - Show available commands
  • exit - Exit the program
  • cmp <program_name> - Compile a C++ program
  • list - List all current test cases
  • run - Run the program with test cases
  • switch <problem_id> - Switch to a different problem
  • other - Run the program with custom input

Example Workflow

  1. Compile your program:
cmp solution.cpp
  1. When test cases are received, they will be automatically stored and displayed.

  2. Run your program against the test cases:

run
  1. Switch between different problems:
switch 1

Configuration

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")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Terminal CPH helper for vim users to get automated test cases

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages