Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Flag Hoist rules: a tested `flag-hoist/hoist.js` that plays a growing signal-flag memory sequence from plain data #145

Closed opened this
opened this

A new Memory game for the catalogue: the harbour master hoists a sequence of signal flags, lowers them, and you hoist the same flags in the same order; each round adds one flag. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] flag-hoist/hoist.js holds the rules as plain data in, plain data out, with no DOM. Six flags, each named and with a stated colour pattern. A round's sequence is drawn from a seed and grows by one flag each round, keeping the earlier flags. hoist(state, flag) accepts the next flag in order; a wrong flag ends the game. Showing time per flag shortens each round down to a stated floor, and the state says which flag is shown at a given time t.
  • [ ] The end reports the longest sequence repeated and the best, with a win line at or above a stated target length and a loss line below it.
  • [ ] flag-hoist/hoist.test.mjs asserts each rule above: the same seed giving the same sequence, a sequence growing by one and keeping its prefix, a right hoist advancing, a wrong hoist ending the game, the showing time reaching its floor, and the win and loss lines at the target.
  • [ ] bun test passes for the new file.

Files: flag-hoist/hoist.js, flag-hoist/hoist.test.mjs. Risk: none outside the folder. Do not touch shell.js, index.html or rounds.mjs here. Fits: a builder.

commented

Closed: already done on main in 8a56e9e2 (pull #161).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs