Skip to content

Commit

Permalink
Merge pull request #365 from govariantsteam/lighthouse_rules
Browse files Browse the repository at this point in the history
add lighthouse rules description
  • Loading branch information
merowin authored Dec 22, 2024
2 parents 2952caf + b7b96bf commit df4a42a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/shared/src/templates/lighthouse_rules.ts
Original file line number Diff line number Diff line change
@@ -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.
`;
2 changes: 2 additions & 0 deletions packages/shared/src/variants/lighthouse/lighthouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -249,4 +250,5 @@ export const lighthouseVariant: Variant<NewGridBadukConfig, LighthouseState> = {
description:
"Each stone casts rays of light that illuminate fields in a line.",
time_handling: "sequential",
rulesDescription: lighthouseRules,
};

0 comments on commit df4a42a

Please sign in to comment.