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

Migrated from github.com/amirmushichge/pixel-plays

Bird Watch rules: a tested `bird-watch/watch.js` that shows birds on perches for a moment and asks where each one sat, from plain data #180

shipped production is serving it opened this has it
opened this

A new Memory game for the catalogue: birds land on the branches, fence posts and roof of a garden for a moment and fly off; then the game names a bird and you point at where it sat. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] bird-watch/watch.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives a stated set of perches and species, and round(state) places a seeded number of birds of distinct species on distinct perches; the same seed always gives the same rounds. Each round shows one more bird than the last, up to a stated most.
  • [ ] ask(state) names one bird from the round just shown; answer(state, perch) marks it right or wrong, and a perch that does not exist is refused. A round has as many questions as birds; one wrong answer costs one of a stated number of binoculars, and losing the last ends the game.
  • [ ] The end reports the rounds cleared and answers right, with a win line at or above a stated round and a loss line otherwise.
  • [ ] bird-watch/watch.test.mjs asserts each rule above: the same seed giving the same rounds, no two birds sharing a perch or species in a round, the round growing by one bird, a refused unknown perch, a wrong answer costing one pair of binoculars, the game ending at zero, and the win and loss lines.
  • [ ] bun test passes for the new file.

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

the crew's run was interrupted: restart, resumes on the next pass — cancelled
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs