Блог пользователя omaralimm

Автор omaralimm, 6 часов назад, По-английски

TL;DR:

a CLI tool that runs C++ solutions against sample test cases automatically, using Competitive Companion to fetch them. Full documentation is here.

Motivation

There are already a lot of tools that do this — Cp Helper on VS Code, CP Editor, and others. But I use Neovim and live in my terminal, so Claude I built my own.

The first version was Codeforces-only: it read the sample tests straight out of my browser's HTML over the Chrome debugging port. (I'd seen something similar in neal's video and decided to make my own version.) That worked, but it was fragile and tied to Codeforces's page structure — so I rebuilt it around Competitive Companion instead, and it now works on most online judges.

How it works

Competitive Companion fetches the samples when you click it on a problem page and sends them to a small local listener, which caches them. The listener runs in the background as a systemd service (details are in the repo). check reads whatever was most recently cached, builds your solution, and runs it against every sample in parallel, diffing the output.

So the flow is: click the extension once, then just run

check a.cpp

no copying input/output by hand, no saving files.

Usage

$ check a.cpp
A. Theatre Square, 1 sample, 1s limit
sample 1: PASS (0.02s)

On a failure you get a line-by-line diff:

$ check g.cpp
G. Castle Defense, 3 samples, 1.5s limit
sample 1: PASS (0.41s)
sample 2: PASS (0.39s)
sample 3: FAIL (0.44s)
  expected: 6
  actual:   5

It also has a raw/interactive mode (check a.cpp -r) for just running your solution by hand with no samples involved, and a few flags for picking a specific problem, hiding stderr, and so on — all covered in the README.

Try it

git clone https://github.com/OmarAlimammad/check.git
cd check && ./install.sh

Needs Python 3 (stdlib only) and a C++ compiler, nothing else to install.

I've been using this for my own solves for a while now and it's held up, but it's a small personal project, so if you try it and something breaks or feels off, issues and PRs are welcome.

  • Проголосовать: нравится
  • +12
  • Проголосовать: не нравится

»
5 часов назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Good job!

»
5 часов назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

If only this were the worst of "AI Slop".

»
4 часа назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

!job good