From 747c8f7f8eba95b5b0fba57f6c45e89d7b14796f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 13 Sep 2026 22:24:20 +0000 Subject: [PATCH] Add 23x23 board size variant to Asli Adds board-23 alongside the existing board-9/11/15/17/19/27 sizes. Asli's boardsize resolution already generically parses any "board-" variant, so no engine logic changes were needed beyond the metadata entry and English/Esperanto variant names. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01JzxdyPNjcMTeQ73PGg2K9S --- locales/en/apgames.json | 3 +++ locales/eo/apgames.json | 3 +++ src/games/asli.ts | 1 + test/games/asli.test.ts | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 test/games/asli.test.ts diff --git a/locales/en/apgames.json b/locales/en/apgames.json index 7df881147..f1e4cc844 100644 --- a/locales/en/apgames.json +++ b/locales/en/apgames.json @@ -968,6 +968,9 @@ "board-19": { "name": "19x19 board" }, + "board-23": { + "name": "23x23 board" + }, "board-27": { "name": "27x27 board" }, diff --git a/locales/eo/apgames.json b/locales/eo/apgames.json index 920557ed3..1b3e07a79 100644 --- a/locales/eo/apgames.json +++ b/locales/eo/apgames.json @@ -656,6 +656,9 @@ "board-19": { "name": "Tabulo 19×19" }, + "board-23": { + "name": "Tabulo 23×23" + }, "board-27": { "name": "Tabulo 27×27" }, diff --git a/src/games/asli.ts b/src/games/asli.ts index 2be772581..bdf95b39b 100644 --- a/src/games/asli.ts +++ b/src/games/asli.ts @@ -60,6 +60,7 @@ export class AsliGame extends GameBase { {uid: "board-15", group: "board"}, {uid: "board-17", group: "board"}, {uid: "board-19", group: "board"}, + {uid: "board-23", group: "board"}, {uid: "board-27", group: "board"}, {uid: "woven", group: "rules"}, {uid: "setkomi", group: "komi"}, diff --git a/test/games/asli.test.ts b/test/games/asli.test.ts new file mode 100644 index 000000000..6b5ad9f88 --- /dev/null +++ b/test/games/asli.test.ts @@ -0,0 +1,23 @@ +import "mocha"; +import { expect } from "chai"; +import { AsliGame } from "../../src/games/asli"; + +describe("Asli", () => { + it("includes the 23x23 board size in the variant metadata", () => { + expect(AsliGame.gameinfo.variants).to.deep.include({ uid: "board-23", group: "board" }); + }); + + it("uses a 23x23 board when the board-23 variant is selected", () => { + const game = new AsliGame(undefined, ["board-23"]); + const rep = game.render(); + + expect(game.boardsize).to.equal(23); + expect(rep.board).to.include({ width: 23, height: 23 }); + expect(game.getGraph().graph.order).to.equal(23 * 23); + expect(game.coords2algebraic(22, 0)).to.equal("w23"); + + const restored = new AsliGame(game.serialize()); + expect(restored.variants).to.deep.equal(["board-23"]); + expect(restored.boardsize).to.equal(23); + }); +});