Skip to content
Merged
8 changes: 8 additions & 0 deletions locales/en/apgames.json
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,14 @@
},
"size-7": {
"name": "Hexagonal board (base-7)"
},
"#ruleset": {
"description": "Only one group results in a score of zero.",
"name": "Two groups needed"
},
"1-group": {
"description": "Only one group results in a score of its size.",
"name": "One group needed"
}
},
"pylon": {
Expand Down
7 changes: 5 additions & 2 deletions src/games/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ export class GoGame extends GameBase {
dateAdded: "2026-02-25",
// i18next.t("apgames:descriptions.go")
description: "apgames:descriptions.go",
urls: ["https://boardgamegeek.com/boardgame/12146/go"],
urls: [
"https://boardgamegeek.com/boardgame/188/go",
"https://senseis.xmp.net/"
],
people: [
{
type: "designer",
name: "Traditional",
urls: ["https://boardgamegeek.com/boardgamedesigner/"],
urls: ["https://en.wikipedia.org/wiki/Go_(game)"],
},
{
type: "coder",
Expand Down
27 changes: 22 additions & 5 deletions src/games/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export class ProductGame extends GameBase {
dateAdded: "2024-02-19",
// i18next.t("apgames:descriptions.product")
description: "apgames:descriptions.product",
urls: ["https://boardgamegeek.com/boardgame/136995/produto",
"https://jpneto.github.io/world_abstract_games/product.htm"],
urls: [
"https://boardgamegeek.com/boardgame/136995/produto",
"https://jpneto.github.io/world_abstract_games/product.htm"
],
people: [
{
type: "designer",
Expand All @@ -49,6 +51,7 @@ export class ProductGame extends GameBase {
{ uid: "#board", },
{ uid: "size-6", group: "board" },
{ uid: "size-7", group: "board" },
{ uid: "1-group", group: "ruleset" },
],
flags: ["scores", "no-moves", "experimental"]
};
Expand All @@ -63,6 +66,7 @@ export class ProductGame extends GameBase {
public stack!: Array<IMoveState>;
public results: Array<APMoveResult> = [];
public boardSize = 5;
private ruleset: "default" | "1-group";

constructor(state?: IProductState | string, variants?: string[]) {
super();
Expand Down Expand Up @@ -91,6 +95,7 @@ export class ProductGame extends GameBase {
this.stack = [...state.stack];
}
this.load();
this.ruleset = this.getRuleset();
}

public load(idx = -1): ProductGame {
Expand Down Expand Up @@ -125,6 +130,11 @@ export class ProductGame extends GameBase {
return 5;
}

private getRuleset(): "default" | "1-group" {
if (this.variants.includes("1-group")) { return "1-group"; }
return "default";
}

private getGraph(): HexTriGraph {
return new HexTriGraph(this.boardSize, this.boardSize * 2 - 1);
}
Expand Down Expand Up @@ -181,9 +191,16 @@ export class ProductGame extends GameBase {
groups.push(group);
}

while ( groups.length < 2 ) {
// guarantee that players always have, at least, two groups
groups.push(new Set());
if (this.ruleset === "1-group") {
while ( groups.length < 2 ) {
// guarantee that players always have, at least, two groups
groups.push(new Set(['dummy'])); // here, of size 1
}
} else {
while ( groups.length < 2 ) {
// guarantee that players always have, at least, two groups
groups.push(new Set());
}
}
return groups.map(g => g.size).sort((a, b) => b - a);
}
Expand Down
8 changes: 5 additions & 3 deletions src/games/stiletto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class StilettoGame extends InARowBase {
dateAdded: "2026-02-21",
// i18next.t("apgames:descriptions.Stiletto")
description: "apgames:descriptions.stiletto",
urls: ["https://jpneto.github.io/world_abstract_games/dagger_gomoku.htm"],
urls: [
"https://boardgamegeek.com/boardgame/465550/stiletto",
"https://jpneto.github.io/world_abstract_games/dagger_gomoku.htm",
],
people: [
{
type: "designer",
Expand All @@ -52,8 +55,7 @@ export class StilettoGame extends InARowBase {
apid: "9228bccd-a1bd-452b-b94f-d05380e6638f",
},
],
categories: ["goal>align", "mechanic>place", "board>shape>rect",
"board>connect>rect", "components>simple>1per"],
categories: ["goal>align", "mechanic>place", "board>shape>rect", "components>simple>2c"],
flags: ["no-moves", "custom-colours", "experimental"],
};

Expand Down