A small in-browser tool for experimenting with a 5-node directed-edge puzzle. It does not solve the puzzle for you — it just lets you build orderings and see what they do.
- 5 nodes: A, B, C, D, E (a full graph = the pentagon + the inner star, so 10 possible undirected edges).
- One seed node starts at value
1; every other node starts at0. - You apply directed edges in order. Applying
ABdoesB += A(thefromnode is unchanged, its value is added to thetonode). - Each undirected pair can be used at most once: using
ABblocks bothABandBAlater. - Goal: get the highest node value to
30.
-
Each card is one ordering. Type one edge per line, e.g.
AB BC CA -
Pick the seed node (the one that starts at
1). -
Drag the scrubber to step through the ordering and watch values propagate. Applied edges are drawn with direction arrows and an order number.
-
Illegal states are allowed while editing (duplicate pairs, self-loops, malformed lines). They're flagged with a red border and an error list, but the app keeps simulating the mechanically-applicable edges so you can keep moving.
-
Clone an ordering to branch from it; + New ordering for a blank one.
-
Orderings persist to
localStorage.
- React + TypeScript + Vite
- zustand for the central state store
(with
persisttolocalStorage) - ts-pattern for parsing/classifying edge lines
- Pure, immutable puzzle logic in
src/puzzle.ts
npm install
npm run dev # start the dev server
npm run build # type-check + production build
npm run preview # preview the production build