Principles
The handful of non-negotiables every spec, plan, and task in this project answers to.
Five rules keep an over-engineered toy honest: the rules stay pure, the whole thing ships as one file, every opponent is swappable, correctness is proven by play rather than asserted, and the surface stays calm and legible.
§1 Purpose & scope
A single-file browser game whose real job is to teach an algorithmic progression — from a coin-flip to tree search. In scope: the 3×3 game, six engines, and two- and three-player modes. Out of scope: a general game framework — this is a teaching artifact, not a platform.
§2 Principles
Rules are pure and framework-free
The board, legal moves, and win/draw detection are pure functions with no DOM, no engine, and no I/O. Everything else depends on them; they depend on nothing.
One self-contained file ships
No build, no dependencies; it opens straight from file://. If it needs a toolchain to run, it has grown too big.
Every opponent is swappable
All engines hide behind a single chooseMove(engine, board, player, players) interface. Adding intelligence never edits the game loop.
Correctness is demonstrated, not asserted
"Unbeatable" is a test that plays games, not a comment in the source. A claim the suite can't reproduce is not a claim.
A calm, legible surface
Wordle-grade clarity: the board reads at a glance and nothing on screen fails to earn its place.
§3 Governance
Principles change only by proposal, and the set carries a semantic version. Every plan opens with a principles check that must pass before design proceeds.
§4 Change log
One file. Renders anywhere. Degrades to readable static HTML.