# CrystalGo rules

CrystalGo is a two-player game of stationary stones and changing connections. On each turn, place a stone, flip a three-tile patch, or pass. Groups and liberties follow the current tile edges.

[Play locally](../crystal.html) · [Interactive tutorial](../crystal-learn.html)

## Board and start

Use the supplied side-four hexagonal lozenge tiling: **61 permanent vertex playing points, 108 edges and 48 rhombi**. All points begin empty. Black plays first; colors alternate. The outer boundary stays fixed, with no wrapping.

Stones occupy vertices. **Only drawn tile sides connect points.** Nearby points and opposite corners of a rhombus are not connected unless an edge is drawn between them. Coordinates `(a,b)` name fixed points and do not change when tiles flip.

CrystalGo is a separate planar game. It does not use the wrapping or fixed adjacency of the three surface Go variants.

## Groups and liberties

A group contains same-color stones connected along current tile sides. Its liberties are the distinct empty vertices adjacent by an edge to any stone in that group. A shared liberty counts once.

Recompute groups and liberties from the current graph after every action. Stones remain at their fixed points until captured.

## A turn

Choose exactly one action:

- **Place** one stone of your color on an empty point.
- **Flip** one eligible three-rhombus patch. This uses the whole turn and places no stone.
- **Pass**, leaving the board unchanged.

A player may also resign, losing the game.

### Eligible flips

Three rhombi must form a unit regular hexagon inside the board, meeting at an **empty interior degree-three vertex**. Exchange the center’s current three alternating spokes for the complementary three spokes to the six surrounding vertices.

All seven point positions, their stones, all six perimeter edges, and every connection outside the patch stay fixed. Only the center must be empty; surrounding points may contain stones. Boundary degree-three points are not eligible. Recompute eligibility after a change to the graph or stones.

A stone at a center blocks that center’s flip while it remains there. It does not freeze every neighboring connection. A geometrically eligible flip can still be forbidden by suicide or repetition.

Every changed edge has the empty center at one endpoint. Therefore a flip cannot directly split or merge connections among surviving stones. It can change liberties and empty regions, and thereby capture stones.

## Capture, suicide and rejected actions

After a placement or flip:

1. Identify **all opposing groups with no liberties**, then remove them simultaneously.
2. Reject the action if **any group of the mover’s color** has no liberties after those captures.
3. Check the resulting full position against the repetition history.

Captured stones earn no separate prisoner points. An illegal action leaves the board, player to move, pass count and history unchanged. Placement and flip preconditions are checked before action resolution.

## Positional superko

A non-pass action is forbidden if its position after captures reproduces **both the complete tile edge set and the full stone coloring** from any earlier position, including the initial empty board.

The player to move is excluded from the comparison. Passes are exempt and do not erase history. Any accepted placement or flip resets the consecutive-pass count.

The same visible position, player to move and pass count can arise through different histories with different legal replies. For example, compare these records from the exact start:

| Turn | History A | History B |
| --- | --- | --- |
| Black 1 | Place `(−4,−4)` | Flip `(1,0)` |
| White 2 | Place `(4,4)` | Place `(4,4)` |
| Black 3 | Flip `(1,0)` | Place `(−4,−4)` |

White’s inverse flip at `(1,0)` is forbidden after A because it restores turn 2, but legal after B. The [history demonstration](../crystal-learn.html#history) replays both records and checks each reply.

Game records must retain all accepted actions from the exact start. When reviewing an earlier turn and starting a new branch, repetition uses that branch’s complete prefix. The abandoned continuation is not part of the new branch’s history.

Reviewing a finished game does not reopen its final position. An explicitly confirmed takeback creates a new branch from an earlier position and removes the later recorded ending. Export the original complete line first if you want to retain that result.

## Ending and scoring

**Two consecutive passes end the game immediately.** Score the actual board that remains:

- One point for each stone of your color.
- One point for each empty vertex in an empty connected component touching your stones and no opposing stones.
- A component touching both colors or neither color is neutral.

Count vertices, not the Euclidean area of tiles. Contact with the outer boundary does not make an empty region neutral. For example, a lone Black stone followed by two passes scores 61–0, because the other 60 connected vertices touch only Black. This is an illustration of the rule, not a suggested strategy.

There is **no automatic removal of presumed-dead stones and no resumption** after the terminal passes. Capture a group during play if you need it removed. Higher score wins; equal scores draw. Resignation loses without requiring an area result.

## Eyes and changing connections

Two enclosed empty points under the current graph do not automatically give a group passive safety. A flip can connect an apparent eye to outside emptiness and permit a previously suicidal invasion.

The [eight-stone example](../crystal-learn.html#eyes) starts with two such eyes and ends with all eight stones captured in a legal 46-turn record when Black keeps passing. It disproves passive safety; it does **not** prove that Black must die against active defense.

A useful sufficient protected shape is one connected group with two empty interior points, each surrounded by friendly stones at **all six possible triangular-grid neighbors**. Every possible spoke at either eye reaches the group, and the other eye prevents a capturing invasion. The group cannot be captured while its owner preserves both empty points. The [eleven-stone demonstration](../crystal-learn.html#protected-eyes) shows this shape. It is a sufficient condition, not a necessary one and not an additional rule.

## Initial playtest setting

Komi is **zero provisionally**. This is not an estimate of fair komi. Strategic balance and a calibrated single-game komi remain open playtest questions.

To compare players, play pairs with colors exchanged, resetting to the exact starting tiling and empty history for each game. A simple match awards one match point per win and half a point per draw; equal totals draw. This equalizes assignment of the first-move role, not established winning chances.

Retain complete records for replay, including placements, flips, passes, captures and the ending. The application stores games locally; the tutorial uses isolated records and does not change saved games.

## Game records and local storage

**Menu → Save game** exports the entire recorded line, including later moves when reviewing an earlier position. **Load file** validates every action before asking to replace the current workspace. Invalid files leave the current game unchanged.

The JSON format is `crystal-go-game`, version `1`, with rules identifier `crystal-go-side4-v1` and `komi: 0`. Each action records its type, player, captured point indices and, for placement or flip, the chosen point index. Indices follow the fixed order in `src/crystal-geometry.js`. The `cursor` records the viewed position; the `final` checkpoint records the endpoint’s complete position key, turn, consecutive passes and result. Imports rebuild all intermediate graphs, captures and repetition history from the exact starting board and compare the supplied evidence with the replay. A position without that history is not an importable game.

The application permits up to **4,096 actions per record**, with a warning from action 4,000, and imports up to **2 MiB**. At the action limit, export the record before starting another game. Reaching this application limit does not award a result or count as a rule-based ending.

CrystalGo autosaves under its own browser-storage key. Concurrent tabs coordinate through Web Locks; if another tab changes the stored game, the older tab pauses saving. Export its work before reloading. Unreadable saved bytes remain available for download and are never automatically replaced. If storage or Web Locks are unavailable, play remains possible with JSON exports. Game records contain no player identities or other personal information.

## Demonstrations and verification

The tutorial’s ko, eye, protected-shape and history examples are full legal replays on the 61-point board, not edited diagrams. Their action sequences are in [`src/crystal-lessons.js`](../releases/5039030bbd83439cd1f1/src/crystal-lessons.js); the lesson regression tests check captures, suicide, repetition, surviving groups and area counts. Run the project tests with `npm test`.

No result for a smaller board determines the value or komi of this board. These rules make no claim of established balance, novelty or priority.
