From b7b96bf326ff857af8cff4a1d74440ab581b6ee0 Mon Sep 17 00:00:00 2001 From: merowin Date: Sun, 22 Dec 2024 12:23:49 +0100 Subject: [PATCH] add lighthouse rules description --- .../shared/src/templates/lighthouse_rules.ts | 37 +++++++++++++++++++ .../src/variants/lighthouse/lighthouse.ts | 2 + 2 files changed, 39 insertions(+) create mode 100644 packages/shared/src/templates/lighthouse_rules.ts diff --git a/packages/shared/src/templates/lighthouse_rules.ts b/packages/shared/src/templates/lighthouse_rules.ts new file mode 100644 index 0000000..215d8bf --- /dev/null +++ b/packages/shared/src/templates/lighthouse_rules.ts @@ -0,0 +1,37 @@ +export const lighthouseRules = ` +Introduction +------------ +Lighthouse is a variant of Go / Baduk where players have partial information about the board position. Stones cast light rays that illuminate fields for their owner. + +Partial Information +------------------- +Players see different parts of the true (hidden) board state. The visibility of fields and stones is different for each player. + +Visibility +---------- +Every stone illuminates fields for its owner in straight lines extending in all directions until meeting another stone. +- Illuminated fields display their true state (empty or black or white stone). +- Not illuminated fields display their last known information. + +Last Known Information +---------------------- +The last known information of a field is the state from the last time when the field was illuminated, or "empty" if the field was never illuminated before. + +Revealing a field +----------------- +When a stone is placed on a field that is not illuminated, it is possible that this field is secretly occupied. In this case, the players move does not result in a stone placement, but the field gets revealed. + +Revealing a field results in updating the last known information for this player. + +Similarly when a chain gets captured, the owner can deduce that adjacent fields are occupied by the other color. To aid the player, the adjacent fields are revealed. + +Ko and self capture +------------------- +A move is not allowed if it results in repeating a previous board position, and both times occurred during the same players turn. + +Self capture is allowed. + +Observer view +------------- +Observers can see a much smaller portion of the board. This is to avoid that players can gain information by looking at the observer view. +`; diff --git a/packages/shared/src/variants/lighthouse/lighthouse.ts b/packages/shared/src/variants/lighthouse/lighthouse.ts index c3fa2c9..fd31c07 100644 --- a/packages/shared/src/variants/lighthouse/lighthouse.ts +++ b/packages/shared/src/variants/lighthouse/lighthouse.ts @@ -3,6 +3,7 @@ import { Coordinate, CoordinateLike } from "../../lib/coordinate"; import { Grid } from "../../lib/grid"; import { examineGroup, getGroup, getOuterBorder } from "../../lib/group_utils"; import { SuperKoDetector } from "../../lib/ko_detector"; +import { lighthouseRules } from "../../templates/lighthouse_rules"; import { Variant } from "../../variant"; import { Baduk, Color } from "../baduk"; import { NewGridBadukConfig } from "../baduk_utils"; @@ -249,4 +250,5 @@ export const lighthouseVariant: Variant = { description: "Each stone casts rays of light that illuminate fields in a line.", time_handling: "sequential", + rulesDescription: lighthouseRules, };