Skip to content

Commit f571269

Browse files
committed
Dameo: Add 3-row 10x10 version
1 parent 6865d46 commit f571269

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

locales/en/apgames.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,10 @@
10051005
"name": "Anti-Dameo"
10061006
},
10071007
"size-10": {
1008-
"name": "10x10 board (experimental)"
1008+
"name": "10x10 board (4 rows; experimental)"
1009+
},
1010+
"size-10b": {
1011+
"name": "10x10 board (3 rows; experimental)"
10091012
}
10101013
},
10111014
"deckfish": {

src/games/dameo.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class DameoGame extends GameBase {
5353
],
5454
variants: [
5555
{ uid: "size-10", group: "board" },
56+
{ uid: "size-10b", group: "board" },
5657
{ uid: "anti" },
5758
],
5859
categories: ["goal>annihilate", "mechanic>capture", "mechanic>differentiate", "mechanic>move>group", "board>shape>rect", "board>connect>rect", "components>simple>1per"],
@@ -67,14 +68,14 @@ export class DameoGame extends GameBase {
6768

6869
public coords2algebraic(x: number, y: number): string {
6970
let boardsize = 8;
70-
if (this.variants.includes("size-10")) {
71+
if (this.variants.includes("size-10") || this.variants.includes("size-10b")) {
7172
boardsize = 10;
7273
}
7374
return GameBase.coords2algebraic(x, y, boardsize);
7475
}
7576
public algebraic2coords(cell: string): [number, number] {
7677
let boardsize = 8;
77-
if (this.variants.includes("size-10")) {
78+
if (this.variants.includes("size-10") || this.variants.includes("size-10b")) {
7879
boardsize = 10;
7980
}
8081
return GameBase.algebraic2coords(cell, boardsize);
@@ -92,7 +93,7 @@ export class DameoGame extends GameBase {
9293
private _points: [number, number][] = [];
9394

9495
public get boardsize(): number {
95-
if (this.variants.includes("size-10")) {
96+
if (this.variants.includes("size-10") || this.variants.includes("size-10b")) {
9697
return 10;
9798
}
9899
return 8;
@@ -103,7 +104,10 @@ export class DameoGame extends GameBase {
103104
if (state === undefined) {
104105
this.variants = variants === undefined ? [] : [...variants];
105106
const board = new Map<string, CellContents>();
106-
const half = this.boardsize / 2;
107+
let half = this.boardsize / 2;
108+
if (this.variants.includes("size-10b")) {
109+
half--;
110+
}
107111
for (let deltaRow = 0; deltaRow < half - 1; deltaRow++) {
108112
for (const row of [0 + deltaRow, this.boardsize - 1 - deltaRow]) {
109113
for (let col = deltaRow; col < this.boardsize - deltaRow; col++) {

0 commit comments

Comments
 (0)