Reference · Rules, maps and records
playTenkafunction
The game after the player to move makes move, or null when they may not:
a move for another phase, a territory not theirs, a neighbour that is not
one, dice they have not the armies for, a set that is not a set.
Import it
import { playTenka } from "@johnmorrisdotca/tenka";
Definition
function playTenka(game: TenkaGame, move: TenkaMove): TenkaGame | null
Parameters
| Name | Type | Description |
|---|---|---|
game | TenkaGame | The current native game state. |
move | TenkaMove | The native move to apply or encode. |
Returns
TenkaGame | null
The new game, or null when the move is not legal in the current phase.
Examples
import { playTenka, startTenka, tenkaMoves } from "@johnmorrisdotca/tenka";
const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(playTenka(game,tenkaMoves(game)[0])?.moves.length);1What it prints (run when this page was built)