Site updates
Every build of this site and what changed, newest first. This page is not linked from the game and is kept out of search engines.
Current build: 2026.11.14.005
-
A tidy-up of the code, with no change to how the game looks or plays. Names that were still terse now say what they are for (
sideLetterisgetSideLetter,computerSideisgetComputerSide, and the sort and test variablesa,bandiare spelled out). The build no longer uses a type cast to readbuild-number.json: it checks the file's shape and fails with a clear message if it is wrong. The TypeScript settings move to the ES2024 language level and also refuse unused labels.wrangler.jsoncalready carries the emptypreviewsblock from the last change, so nothing more was needed there. -
Fixed the failing Cloudflare preview build on pull requests. Cloudflare runs
npx wrangler previewfor those, which needs an (empty)previewsblock in the Worker's configuration, so it stopped with an error before deploying anything. Added the block towrangler.jsonc; the site itself is unchanged. -
The code is now TypeScript with strict type checking, and every name says what it is for. No change to how the game looks or plays, apart from one thing under the hood: the game scripts are now loaded as modules. The rules in
src/engine.tsuse precise types (a side is only a cross or a nought, a square is only 0 to 8, a strength only 1 to 10, a board is nine read-only squares), so a wrong move or a missed case is caught when the code is checked, before anyone can play it. The tests prove the compiler refuses bad calls, andnpm testnow type-checks first.Names were reworked throughout, for example
winnerisfindWinner,playisplayMove,statusisgetOutcome, ands,vandibecamecontents,scoreandsquare. The board is now always rebuilt from the list of moves, so the two can never disagree. The rules also refuse a move made out of turn, which matters once there is a server, and the status line is no longer rewritten (and so re-read by a screen reader) every time you press an arrow key. The standards are written into the repo'sCLAUDE.md. Changed on the play page, which now linksgame.jsas a module. -
A new icon: a cream cross standing on an ochre line, with a fainter reflection of it below, so the tab icon no longer looks like the usual noughts-and-crosses mark. The icon files are regenerated by
scripts/generate-favicons.js; no page changes. -
The game now starts in Computer mode (you play crosses against strength 5) instead of Two players, so you can make your first move straight away. Two players is still one click away under Opponent. Changed in
game.js, with a browser test for the new starting state and a line on the help page. -
The first version of the game: noughts and crosses for two players on one screen, or against the computer. The computer has ten strengths, from 1 (plays a random square most of the time) to 10 (never makes a mistake, so it can only draw or win). There is Undo, a list of moves, a score for the visit, and the winning squares are lit up. The board works from the keyboard as a single Tab stop with arrow keys. The page is on the play page, with help and site updates.
The look, the build and the tests follow the Romanian Draughts game: the rules and the computer are in
src/engine.js(tested exhaustively, including that strength 10 never loses),build.jsgeneratespublic/, and the browser tests check accessibility in light and dark, the security headers and the keyboard.