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); + }); +});