legalActionsfunction
Every placement allowed now, a bot's or a test's whole view of what can be done.
Import it
import { legalActions } from "@johnmorrisdotca/houseki/tsumiki";
Definition
function legalActions(state: GameState): readonly Action[]
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The game. |
Returns
readonly Action[]
Every placement allowed; empty once the game has ended.
Examples
import { createGame, legalActions } from "@johnmorrisdotca/houseki/tsumiki";
console.log(legalActions(createGame({ seed: "demo" })).length > 0);trueWhat it prints (run when this page was built)