Skip to the content

Sugoroku双六

Play backgammon and its relatives with native rules, cube and match scoring, seeded dice and replayable records.

Sugoroku is the Japanese name 双六 for games of tables. About the name

Contents

Reference · Board and position elements

readEmbedPositionfunction

Reads a GNU position ID or bounded JSON position; null means invalid counts or input.

Import it

import { readEmbedPosition } from "@johnmorrisdotca/sugoroku/element";

Also exported from: @johnmorrisdotca/sugoroku/element/define

Definition

function readEmbedPosition(text: string | null, variant?: VariantKey, turn?: Side): Position | null

Parameters

NameTypeDescription
textstring | null

Position ID, JSON position, or null for the variant's start.

variant (optional)VariantKey

The native variant used for checker counts and layout.

turn (optional)Side

The on-roll side encoded by a GNU ID.

Returns

Position | null

A complete position, or null for malformed or inconsistent input.

Examples

import { readEmbedPosition } from "@johnmorrisdotca/sugoroku/element";
console.log(readEmbedPosition("4HPwATDgc/ABMA")?.points[0].length);
24

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/sugoroku 1.1.1.