Reference · Rules, games and records
newGamefunction
A new game, waiting for the opening throw.
Import it
import { newGame } from "@johnmorrisdotca/sugoroku";
Definition
function newGame(settings: Settings, options?: NewGameOptions): GameState
Parameters
| Name | Type | Description |
|---|---|---|
settings | Settings | The resolved variant and complete rules. |
options (optional) | NewGameOptions | Native drawing, geometry, mounting or computer choices specified by the signature. |
Returns
GameState
A new game, waiting for the opening throw.
Examples
import { newGame, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
console.log(newGame(settings).phase);openingWhat it prints (run when this page was built)