Skip to the content

Houseki宝石

Run five native gem and stone engines, play measured challenges and lessons, and save deterministic games.

Houseki (宝石) is Japanese for a gem or precious stone. About the name

Contents

Reference · Tsumiki

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

NameTypeDescription
stateGameState

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);
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/houseki 0.5.0.