Skip to content
ffrancoaPublic

About

A minimal CLI to give your Rust some exercise.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

xrc

Crates.io PyPI License: MIT

A minimal CLI to give your Rust some exercise.

xrc turns a coding-problem URL into a ready-to-solve Rust project: it scrapes the problem page, writes a clean cargo project with the statement, constraints, and sample tests already wired up, and gets out of your way so you can focus on the fun part: solving it. It also tracks your progress as you go.

Install

With cargo:

cargo install xrc

Or, if you live in the Python world, grab the prebuilt binary from PyPI:

pip install xrc      # or: uv tool install xrc

Pull a problem

Point xrc at a problem you want to work on:

xrc pull https://dmoj.ca/problem/aplusb
xrc pull https://leetcode.com/problems/two-sum/

This creates a self-contained project under exercises/:

exercises/
└── a_plus_b/
    ├── Cargo.toml
    ├── src/
    └── tests/

The problem statement lives right in the source as comments, and the sample cases are already turned into tests. Open it up and start writing your solution.

Supported sites today: dmoj.ca and leetcode.com.

Check your progress

When you think you have it, let xrc run the tests for every exercise and keep score:

xrc check

Solved problems are remembered, so check skips them next time and only runs what's left. A few flags for when you need them:

xrc check --verbose   # show the full build and test output
xrc check --recheck   # re-run everything, even already-solved problems

Your progress is saved in exercises/.xrc_progress.json, so you can pick up right where you left off.

License

Released under the MIT License.

About

A minimal CLI to give your Rust some exercise.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages