Add C++ as a playable language
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with backend/arena/runner/harness.js, comparing pythonProgram and javascriptProgram, then inspect LANGUAGES, starterCode, and the relevant tests in backend/tests/. Implement a C++ driver and typed starter code for supported problem types, wire up the Judge0 language id, and validate correct and incorrect solutions across difficulty levels and types using a real Judge0. Done means npm test and node scripts/check-boundary.js pass.
Written by the indexing model from the issue text.
Description
Popular for competitive programming. C++ has no built-in JSON reader, so the driver needs a small parser for the input format above. std::pair / std::tuple cover the tuple types.
CodeArena runs player code in Python, JavaScript and TypeScript. Adding a language is self-contained and a great way to get into the codebase.
Where the code lives
backend/arena/runner/harness.js: one small driver per language. The driver reads{"tests":[{"args":[...]}]}as JSON on stdin, calls the player's function once per test, and prints the per-run marker line followed by a JSON array of{ ok, value }/{ ok, error }. Copy the shape ofpythonProgram/javascriptProgram. The marker nonce must stay per-run.LANGUAGESin the same file: add{ label, judge0Id }.starterCode(problem, language): typed starter code built fromproblem.function(name,params[].type,returns).backend/arena/runner/executors.js:localExecutoronly knowsnodeandpython3; add your compiler for local development if you like (it is never used in production).
Types the 45 problems use
integer, integer[], integer[][], number[], string, string[], boolean, and tuples: [integer, integer], [integer, integer][], [integer, integer, integer][], [string, integer][], [string, string, string][], [integer, integer, string].
Statically typed languages need a mapping for each of these. If a mixed tuple such as [string, integer] has no clean equivalent in your language, it is fine to leave that problem out for your language rather than force an awkward type: the loader supports per-problem languages via runnableLanguages.
Definition of done
- Driver plus typed starter code for every problem your language supports.
- Judge0 language id wired up (Judge0 CE: Java 62, C++ 54, Go 60; confirm on your Judge0 instance).
- Proof: correct solutions pass and wrong ones fail on a spread of problems (easy, medium, hard, and every type above) against a real Judge0 (
docker-compose.judge0.ymlin the repo root runs one locally). - Tests in
backend/tests/covering the driver output and starter code;npm teststays green. node scripts/check-boundary.jspasses.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sennaicodes/codearena
-
Add issue and pull request templatesMay be free again @franciscorodr26 claimed this 17 days ago, and no pull request is open. Opendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
sennaicodes/codearena#13 · 1 comment ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 45/100
sennaicodes/codearena#34 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 35/100
sennaicodes/codearena#33 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 45/100
sennaicodes/codearena#32 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 38/100
sennaicodes/codearena#31 ·
All issues in sennaicodes/codearena
Similar issues
-
area: apple-music area: build-release bug effort: small priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ChristianTabor/Argon#32 ·
Maintainers usually reply within 1 day
-
0️⃣ phase/new
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Link Checker ReportOpenautomated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
good first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day