Something went wrong. Try again.
A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development. cameron.tngl.io/misaligned
Something went wrong. Try again.
588 B · 7 lines
TypeScript
at main
12345678// One page at a time. Sites, You, Fronts, Rogues, Paper, the tree and the Select list sit in the same spot// over the map, so a page that opens closes whichever other one is open. Screen state only: no rules here.const pages = new Map<string, () => void>();/** A page's way to close itself without telling the others (its flag, and nothing more). */export function onePage(name: string, close: () => void) { pages.set(name, close); }/** `name` is opening: close every other page. */export function opening(name: string) { for (const [k, close] of pages) if (k !== name) close(); }