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:
co-authored by
Claude Sonnet 5.5
parent
08b462d5cc
commit
b83f94894e
@@ -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')
|
||||
Reference in New Issue
Block a user