Vibe-coded Torus
donut.c draws a spinning 3D torus with nothing but text characters. I rebuilt it in Rust to practice running an agentic workflow instead of typing the code myself.
I set up two Claude Code agents: one that only works out the math, and one that writes the code and can’t use a formula until the math agent approves it. Claude wrote the math and the Rust. I set the context and the spec, and steered each step with tests. The version below is a port that runs in your browser.
- Rust
What I did
- Two agents split the work: a math advisor that never writes code, and a coder that checks every formula with it first.
- Samples points on the torus, rotates them, projects them and shades each one with 12 characters.
- The math lives in its own spec, and tests cover projection, light and rendering.
- Runs anywhere with one Docker command.