Tic-tac-toe in Glyph: a classic 3×3 mode and an Ultimate 9×9 mode (nine boards inside nine boards), with an AI opponent that thinks in a web worker. The engine and search are written in Glyph and compiled to browser-loadable ES modules.
npm install
npm startThen open http://localhost:8787.
The first npm start also compiles the Glyph engine to assets/engine/
(via tools/build-web.mjs); without that step the page loads but the board
stays empty because the browser modules 404. Later starts skip the build if
assets/engine/ already exists.
After editing the engine source (src/xox.glyph, src/ultimate.glyph,
src/ultimate_ai.glyph), regenerate the browser modules:
npm run build:webThe server reads assets from disk on every request, so a reload in the browser picks the new build up — no restart needed.
The same engine also plays in the terminal:
npx glyph run . cliAnything after cli is passed through to the CLI game.
src/— Glyph sources: game rules, AI search, web server, CLIassets/— the static web app (index.html,app.js, styles, worker)assets/engine/— generated browser build of the Glyph engine (gitignored)tools/build-web.mjs— Glyph → browser ES-module pipeline, with audit and smoke testspecs/— specifications
