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 · Playable board

SoundPlayertype

Optional board-sound playback and cleanup methods.

Import it

import type { SoundPlayer } from "@johnmorrisdotca/sugoroku/play";

Definition

type SoundPlayer = {
    play: (name: SoundName) => void;
    destroy: () => void;
};

Members

NameTypeDescription
play(name: SoundName) => void
destroy() => void

Stop and let go of everything.

Examples

import { legalPlaysOf, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
import type { SoundPlayer } from "@johnmorrisdotca/sugoroku/play";
import { createSounds } from "@johnmorrisdotca/sugoroku/play";

const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const play = legalPlaysOf(game)[0];
const sounds: SoundPlayer = createSounds({});
console.log(typeof sounds.play);
sounds.destroy();

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