6 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 1aee0050a0 Add Rust support: usaco lang, lint, and main.rs problems
Brings in the stashed Rust work, merged onto the current CLI. A
problem's language is whichever source it has (main.cpp or main.rs);
'usaco lang' sets the default for new problems (.lang, or $USACO_LANG),
and 'new --rust/--cpp' picks per problem. template.rs is a paste-ready
Rust template whose stdio() uses <io>.in/.out when present and
stdin/stdout otherwise.

run/test now feed <io>.in on stdin and capture stdout when the program
doesn't write <io>.out itself, so Codeforces-style solutions work too.
'reset <name> rust|cpp' switches a problem's language (template is
still an alias), and --debug builds Rust with overflow checks and debug
assertions. 'usaco lint' runs clippy through a generated, gitignored
Cargo.toml that also gives rust-analyzer a project; done/skip/undo
keep it in step. LeetCode imports stay C++.

Also: done stages solved/ and solving/ separately, so a problem that
was never committed from solving/ still gets its "Solve" commit, and
the site lists main.rs ahead of other files like it does main.cpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:17:50 +01:00
adamfandClaude Opus 5.5 e821df15f4 Import LeetCode problems with usaco new <link> / usaco daily
Test and publish the site / test (push) Successful in 35s
Test and publish the site / publish (push) Successful in 29s
usaco new <leetcode-link> (alias: from) and usaco daily fetch a problem
from LeetCode's GraphQL API and write problem.md, main.cpp (template
header + LeetCode's C++ starter), a generated driver.h that runs the
solution on LeetCode-format input, and the examples as tests with the
expected outputs from the statement. leetcode.h holds ListNode/TreeNode
and the parse/print helpers; everything local sits behind #ifdef LOCAL
so main.cpp stays submittable.

reset re-fetches the starter code for LeetCode problems, the REPL's new
selects the imported problem, and usaco.zsh turns off globbing so a
pasted ?envType=... link works unquoted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:12:16 +01:00
adamfandClaude Opus 5.5 ac66ad6b03 Tidy the usaco CLI: prefixes everywhere, LOCAL debug builds, git-based dates
- done/skip/undo accept unique prefixes like every other command
- builds define LOCAL (-I repo root): the template includes debugging.h
  and enables DBG/printV only locally, so main.cpp is submittable as-is
- run/build/test --debug (or USACO_DEBUG=1): ASan/UBSan + _GLIBCXX_DEBUG
- list/stats date problems by git history, not mtimes reset by checkouts
- template/tpl is now an alias of reset (which gains -y); fixes template
  dropping the STDIO line
- run shows <io>.out via detect_io instead of the first *.out
- debugging.h: size_t loop indices (no -Wsign-compare noise)
- zsh completion for i/cat/copy; README covers test, io, reset, --debug
- ignore a.out

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 22:39:16 +01:00
adamfandClaude Opus 5.5 1c647072c5 Add usaco sync; track saved test outputs
Test and publish the site / test (push) Successful in 4m29s
Test and publish the site / publish (push) Successful in 1m25s
The website commits too, so `usaco sync` pulls its edits before pushing.
tests/*.out were swallowed by the *.out rule; they are expected outputs
the site shows, so re-include them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00
adamf afdab7d4bd Separate lib, new problems and script for web 2026-08-26 22:25:19 +01:00
adamf 6fd6d70b04 Vibe code scripts to edit and add usaco solutions 2026-08-25 00:45:15 +01:00