feat(js): m05 game and m06 view with fixtures and tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-28 23:45:10 +01:00
co-authored by Claude Sonnet 5.5
parent 08b462d5cc
commit b83f94894e
12 changed files with 1398 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { todo } from './todo.js'
/**
* The one function that says how the game changes: `(state, action) -> state`.
* `Tick` runs a game step (`tick`), `Turn` asks to change direction (`turn`);
* every other action returns the state unchanged for now.
*/
export const update = (state, action) => todo('m05')
/** Apply all actions in order, starting from `state`, and return the final state. */
export const replay = (state, actions) => todo('m05')
/** Like `replay`, but keep every state: `[state, afterFirst, afterSecond, ...]`, so its length is `actions.length + 1`. */
export const history = (state, actions) => todo('m05')