Skip to content

Commit ec11a7e

Browse files
authored
Create README.md
1 parent 29b158a commit ec11a7e

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

README.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# CPJudge
2+
3+
A tiny local **Competitive Programming Judge** written in **C++**.
4+
5+
CPJudge allows you to run your solution locally against predefined test cases and instantly check whether your output matches the expected output.
6+
7+
This tool is useful for practicing competitive programming problems without needing an online judge.
8+
9+
---
10+
11+
## Features
12+
13+
* Run C++ solutions locally
14+
* Automatically test solutions with multiple input files
15+
* Compare program output with expected output
16+
* Simple **PASS / FAIL** test results
17+
* Lightweight and easy to use
18+
19+
---
20+
21+
## Project Structure
22+
23+
```
24+
cpjudge
25+
26+
├── cpjudge.cpp
27+
├── solution.cpp
28+
29+
├── tests
30+
│ ├── input1.txt
31+
│ ├── output1.txt
32+
│ ├── input2.txt
33+
│ └── output2.txt
34+
35+
└── README.md
36+
```
37+
38+
---
39+
40+
## Example Problem
41+
42+
Example solution (`solution.cpp`):
43+
44+
```
45+
#include <iostream>
46+
using namespace std;
47+
48+
int main() {
49+
int a, b;
50+
cin >> a >> b;
51+
cout << a + b << endl;
52+
}
53+
```
54+
55+
Example test files:
56+
57+
**tests/input1.txt**
58+
59+
```
60+
1 2
61+
```
62+
63+
**tests/output1.txt**
64+
65+
```
66+
3
67+
```
68+
69+
---
70+
71+
## Compile
72+
73+
Compile the solution:
74+
75+
```
76+
g++ solution.cpp -o solution
77+
```
78+
79+
Compile the judge:
80+
81+
```
82+
g++ cpjudge.cpp -o cpjudge
83+
```
84+
85+
---
86+
87+
## Run the Judge
88+
89+
```
90+
./cpjudge
91+
```
92+
93+
Example output:
94+
95+
```
96+
Test 1 PASSED
97+
Test 2 PASSED
98+
99+
Passed 2/2 tests
100+
```
101+
102+
---
103+
104+
## Why CPJudge?
105+
106+
When practicing competitive programming, repeatedly copying input/output can be slow.
107+
CPJudge automates this process by running your program against predefined test cases instantly.
108+
109+
---
110+
111+
## Future Improvements
112+
113+
* Colored PASS / FAIL output
114+
* Support for unlimited test cases
115+
* Time limit enforcement
116+
* Command line arguments
117+
* Automatic compilation
118+
* Support for multiple programming languages
119+
120+
---
121+
122+
## License
123+
124+
MIT License
125+
126+
---
127+
128+
## Author
129+
130+
**Jay Dev**
131+
132+
GitHub: https://github.com/jayDevCodes

0 commit comments

Comments
 (0)