Rust keeps the rules
Movement, walls, bug collisions, scoring, and the turn budget live in one small Rust model. Every action returns a board snapshot; restarting restores the same state.
04 A small diversion
Five bugs. Twenty-four turns. A tiny debugging detour: find a route through the codebase and patch the queue.
Move one cell at a time. Face a numbered bug, then patch it for 10 points. Moves and patch attempts use one turn; bumping into a wall or bug is free. Patch all five to win.
Saved board preview. Start the game when you’re ready; there is no timer.
Row 5, column 1 · Facing right
Ahead: clear space
Use the buttons, or focus the board for arrow keys and WASD. Space or Enter patches. Nothing moves between actions.
Movement, walls, bug collisions, scoring, and the turn budget live in one small Rust model. Every action returns a board snapshot; restarting restores the same state.
React draws ordinary HTML cells and buttons, maps keyboard and touch input to actions, and announces results. The board, bug positions, walls, and instructions are readable without canvas.
A bounded game state makes a clear boundary: Rust decides what happens; JavaScript presents it. This is a small experiment in that separation, not a claim that a tiny game needs WASM for speed.
The optional game loads only when you start. If JavaScript or WebAssembly is unavailable, the saved board and rules remain. Reduced motion keeps the same turn-by-turn play, with no animated movement.
Read the Rust game on GitHub Gist →
← Back to the Workshop