Dots & Boxes
Two players, one grid, a little sabotage.
Over 1000 lines of pure functional JavaScript: no shared state, and every move returns a new immutable game state. JSLint strict, documented with JSDoc, and 100% Mocha test coverage.
- Brief
- Build a complete game in pure functional JavaScript, documented and tested.
- Role
- Individual.
- Outcome
- A playable game with a documented API and 100% test coverage.
1000+
lines of pure functions
100%
test coverage
Logic is framework-free, so the interface can change without rewriting the rules.
- 01
Set up
Name the players, pick a theme, start the clock.

- 02
Play
Exactly one edge per move.

- 03
Claim
Close a box and go again.

- 04
Prove
Documented with JSDoc, linted strict, tested to the last edge case.

