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

Changelog

All notable changes to this project are written here. The format follows Keep a Changelog, and the project uses Semantic Versioning.

[Unreleased]

  • The README opens with the package's thumbnail, and the demo carries it as its link preview (og:image) and publishes the card, a dark card and an icon on Pages at thumbnail.png, thumbnail-dark.png and icon.png.

[1.1.1] - 2026-10-31

Changed

  • Biome replaces ESLint as the formatter and linter, with the family's shared settings in scripts/biome-family.json; pnpm lint checks formatting too, and pnpm format applies it. The code is formatted once to 120 columns. Nothing a user of the package sees has changed.
  • TypeScript targets ES2022, treats an indexed read as possibly missing, and refuses switch fallthrough and unmarked overrides.
  • pnpm check also holds every source file to at most 500 lines of code (scripts/check-size.mjs; blank lines, comments, tests and data files are not counted). The board is split across src/elementFrame.ts and src/positionElement.ts, and the play view lives in src/mountView.ts, so those files stay within that.

Fixed

  • The issue chooser's security link shows again: an unquoted colon had made .github/ISSUE_TEMPLATE/config.yml invalid YAML.

[1.1.0] - 2026-10-14

The board and the position are custom elements with the family's standard embed attributes and a shared builder, and the package has an English and Japanese documentation site with a checked example for every export. The rules, dice, records and computer players are unchanged.

Added

  • Add the bilingual documentation site, checked public examples, paired guides, local search and machine-readable pages.
  • Add the shared embed builder and validated playable/position iframe routes. Preserve playable board methods and structured state while adding reflected attributes, host options and display sizes. Add a native SVG position element for GNU position IDs or JSON data; events now bubble across shadow roots with JSON-safe detail.
  • Share a package-independent embed builder for option controls, preview adapters, code tabs and shareable links.

Changed

  • The API link in the header reads "API" in English, so that the header takes the same number of rows in English and in Japanese on a phone, as the demo's test of a language change asks.
  • Synchronize documentation tooling for repository layouts, generated type references, Node entry points and repository-specific README links.
  • Keep complete resource catalogues on the documentation entry index and the active resource beside core navigation; render valid default imports in HTML and Markdown.
  • Group the package family by kind, alphabetize each group, and include the geography packages and REST in Pieces in the shared footer and README.
  • Update the shared family description for addresses in all seven supported countries, including France and Germany.

[1.0.2] - 2026-10-06

Nothing that was exported has changed.

Changed

  • The README takes the family's one layout, fully: a hero picture of the demo on a desk and on a phone in light and dark, a picture of the opening position of six variants, an Install section, an Examples section of twelve examples whose output is what they print (the notation, a record written and replayed, a record refused, the computer at four strengths, and more), and an Accessibility section. Its pictures are in docs/images (WebP, light and dark) and are retaken with pnpm screenshots:readme (it replaces pnpm pictures and the two JPEGs docs/desktop.jpg and docs/phone.jpg); they are not in the tarball, and pnpm test:package fails if one is.
  • pnpm test:readme type-checks and runs every TypeScript and JavaScript example in the README against the built package, as a CI job of its own, and pnpm check holds the README to the family's lint (sections in order, a language on every fence, pictures with alt text, widths and captions, no marketing words, at most 64,000 characters, because npm shows only the first 65,536).
  • Repository only: the package and everything it exports are unchanged. CONTRIBUTING.md is the family's one text with a section of its own for Sugoroku, held to the master in johnmorrisdotca/.github by src/family.test.js; ci.yml and pages.yml are the family's one text (pnpm check, the demo, and the package on Linux, macOS and Windows), and any jobs of the package's own after them.

Fixed

  • The API reference page wraps a long entry path instead of running about 2 px wider than a 360 px screen. Nothing the package exports has changed.

[1.0.1] - 2026-10-05

Nothing that was exported has changed.

Added

  • A test holds every @johnmorrisdotca/sugoroku@N version pin in the README to this package's major version.

Changed

  • The family's list, in the README and in the demo's footer, names all twenty-four packages, Karakuri and Houseki included.
  • The npm description is one sentence of 250 characters or fewer, so npm and its search show it whole; it is also the repository's About text. homepage is the demo site and author is "John Morris", the same in every package.
  • The GitHub Actions workflows use the current versions of the actions (checkout 7, setup-node 7, pnpm/action-setup 6; configure-pages 6, upload-pages-artifact 5 and deploy-pages 5 for Pages), which clears GitHub's Node 20 deprecation warning.

[1.0.0] - 2026-10-01

The first release: Sugoroku, backgammon and its variants, with their rules, the doubling cube and matches, games as text, a computer player and the board drawn and played in a page, and a demo to play.

  • The rules of backgammon: entry from the bar, hitting, blocks, both dice if possible and the larger if only one, doubles four times, bearing off including the higher-number rule; held to a brute-force search on thousands of positions of every variant.
  • Seven variants as rows of settings, and the names ItsYourTurn.com and GoldToken.com printed as presets: Backgammon, Backgammon Race, Anti-Backgammon, Nackgammon, Long Gammon, Hypergammon and Tabula, with matches to 3, 5, 7 and 9 points. How each was read is in docs/VARIANTS.md.
  • The doubling cube (offer, take, drop, beaver off by default), gammon and backgammon scoring, match play with the Crawford rule and the dead cube, the Jacoby rule for money play, giving up and drawing.
  • Games as text that replay against the rules, a seeded dice sequence, standard move notation, positions as text, and GNU Backgammon's position ID for the standard board.
  • A computer player in four strengths (random, greedy, careful, strong) with a cube it can reason about, written for this package.
  • The board drawn as SVG, lying down or standing up, with the checkers, dice and cube, named boards and checkers, any colours, light and dark, and numbers on the points; played by touch and mouse as a function or a <sugoroku-board> tag, with undo, the cube and either side the computer's, in English and Japanese, with optional sounds from Kenney's CC0 Casino Audio pack.
  • A demo with a variant chooser, match length, computer strength and every look.

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