Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lighthouse rules description #365

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};
Loading