Add C++ as a playable language
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- JavaScript
- 星标
- 0
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sennaicodes/codearena 的其他 Issue
-
Add issue and pull request templates可能重新可做 @franciscorodr26 于 17 天前认领,目前没有进行中的 PR。 未关闭documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100
sennaicodes/codearena#13 · 1 条评论 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 45/100
sennaicodes/codearena#34 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 35/100
sennaicodes/codearena#33 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 45/100
sennaicodes/codearena#32 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 38/100
sennaicodes/codearena#31 ·
查看 sennaicodes/codearena 的全部 Issue
相似的 Issue
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 68/100
open-webui/open-webui#33196 · 2 条评论 ·
维护者通常 1 天内回复
-
area: apple-music area: build-release bug effort: small priority: high
难度 2/5 1-3 小时 新手友好度 82/100
ChristianTabor/Argon#32 ·
维护者通常 1 天内回复
-
0️⃣ phase/new
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100