# Rules of play

**Version:** v011 — Piece Type Drift on Arrival

This document completely describes how to play this version of the game.
A reader with only this document and the interface can play a full game
against another player, and the two of them can determine who won.

## The game

Hexagonal chess, after Wladyslaw Glinski. Two players, White and Black,
share one screen and take turns with the same pointer. The board is not a
square grid: it is a large hexagon tessellated into **91 hexagonal
cells**, arranged in eleven vertical files. Cells come in three tones,
repeating across the board, which mark the three colour bounds a bishop
can never leave.

**Files and ranks.** The eleven files are lettered **a b c d e f g h i k
l** from left to right — the letter *j* is skipped, as in Glinski's own
notation. The files have different heights: 6, 7, 8, 9, 10, 11, 10, 9, 8,
7, 6 cells, so the outer files are short and the central f-file is the
tallest. Within each file the cells are numbered **from 1 upward starting
at the White (bottom) end**. A cell is named by its file letter and its
number: `a1`, `f11`, `k7`. Ranks can reach two digits (`e10`, `f11`).

White moves first. Players alternate, one move per turn. Passing is not
allowed.

## Starting position

Each side has eighteen pieces: one king, one queen, two rooks, two
knights, **three bishops**, and **nine pawns**. White's pieces stand on:

- **King** g1, **Queen** e1
- **Bishops** f1, f2, f3 (stacked on the central file, one on each of the
  three cell tones)
- **Knights** d1, h1
- **Rooks** c1, i1
- **Pawns** b1, c2, d3, e4, f5, g4, h3, i2, k1 (a shallow chevron across
  the board)

Black's position is the exact 180° rotation of White's through the centre
cell f6, so the two armies are perfectly symmetric. The interface sets up
the board; you do not place pieces by hand.

## Objective

Checkmate the opposing king: attack it so that the opponent has no legal
move that removes the attack. Delivering checkmate wins the game
immediately. Kings are the one piece the renaming rotation never touches
(see **Piece renaming**), so a king is always present and always
findable, and checkmate stays reachable. Check and checkmate are computed
from the pieces as they currently stand on the board — that is, by their
renamed types — not by the types the move list names them.

## Adjacency

Every cell has two kinds of neighbour:

- **Six orthogonal neighbours** — the six cells that share an *edge* with
  it. These are the rook directions. Within a file, the orthogonal
  neighbours directly above and below are the same file, one rank up or
  down.
- **Six diagonal neighbours** — the six cells that share only a *vertex*
  with it. These are the bishop directions.

A bishop direction always keeps a piece on cells of a single tone; a rook
direction moves between tones.

## Piece movement

- **Pawn** (circle): moves one cell straight forward — toward the
  opponent's side — to an empty cell. It never moves two cells, and it
  never moves backward. It captures onto either of the **two forward
  diagonal cells** (the diagonal neighbours to the forward-left and
  forward-right). White's forward is up the board; Black's is down.
- **Knight** (L shape): leaps to one of up to twelve cells — the cells
  reached by one orthogonal step followed by one diagonal step outward, so
  that the leap lands on neither a rook line nor a bishop line from its
  origin. It jumps over anything in between.
- **Bishop** (triangle): moves any number of empty cells along a diagonal
  (vertex-sharing) direction. Confined for the whole game to cells of its
  one tone.
- **Rook** (square): moves any number of empty cells along an orthogonal
  (edge-sharing) direction.
- **Queen** (asterisk): moves any number of empty cells along any
  orthogonal or diagonal direction.
- **King** (cross): moves one cell to any of its **six orthogonal
  neighbours**.

A piece captures by moving onto a cell occupied by an enemy piece, which
is removed. No piece except the knight may pass through an occupied cell.
You may never capture your own piece.

## Piece renaming

Each time a piece completes a move, its type is reassigned the instant it
arrives, following a fixed rotation:

- a **queen** becomes a **rook**,
- a **rook** becomes a **bishop**,
- a **bishop** becomes a **knight**,
- a **knight** becomes a **pawn**,
- a **pawn** becomes a **queen**.

**Kings are never renamed.** Every other piece is subject to the rotation.

The reassignment takes effect on arrival, before your opponent moves: the
piece's appearance changes to the new type at once, and from that point on
the piece moves, captures, gives check, and can be checkmated as the new
type — a pawn that has just arrived and become a queen moves as a queen on
its next turn. Nothing announces the change; there is no prompt, no
highlight, and no entry in the move list calling attention to it.

The reassignment is applied by the side to move's own move: it is the
mover's arriving piece that is renamed, not the opponent's. A capture
renames the capturing piece (the captured piece is simply removed as
usual). Piece counts and type distributions are **not** maintained: there
is no limit of one queen or two rooks per side, and a board may carry any
number of pieces of any type as successive renames accumulate. The
starting position (above) is unchanged — renaming begins only once a move
is made.

Because the move list records each move by the type the piece *was* when
it left, and the board shows the type it *became* on arrival, the written
move list and the position on the board describe each other only loosely:
the list, read as a text, will name a piece by one type in the move that
placed it and by another type in its next move. This is intended. To know
what a piece is now, read the board, not the list.

## Promotion

A pawn that reaches the **far edge** — the border of cells on the
opponent's side, from which it could advance no further — promotes at
once to a queen, rook, bishop, or knight of its own colour, at its
owner's choice. The interface presents the choice when it occurs. The
move list records the promotion you chose (`=Q`, `=R`, `=B`, or `=N`);
then the renaming rotation applies to the promoted piece as to any
arrival, so the piece on the board is one step along the rotation from
the type you selected (a pawn promoted to a queen arrives as a rook).

## Special moves that do not exist here

There is **no castling**, **no en passant**, and **no two-cell pawn
advance**. These moves of square chess have no counterpart in this
version.

## Check and legality

A king is **in check** when an enemy piece attacks its cell. You may
never make a move that leaves your own king in check; the interface
enforces this by offering only legal moves. If you are in check, every
legal move available to you resolves the check.

## How a game ends

The interface detects each of these conditions automatically and
announces the result in the status line. That announcement is the
authoritative verdict.

**Decisive result:**

- **Checkmate.** The player to move is in check and has no legal move.
  That player loses; the other player wins.

**Draws (neither player wins):**

- **Stalemate.** The player to move is not in check but has no legal move.
- **Fifty-move rule.** Fifty consecutive full moves pass with no capture
  and no pawn move.
- **Threefold repetition.** The same arrangement of pieces, with the same
  player to move, occurs for the third time.
- **Insufficient material.** Neither side retains enough material to ever
  deliver checkmate — king against king, king and a single knight or
  bishop against king, or kings with only bishops that all stand on one
  colour tone.

## Determining the winner

Play until the status line announces a result. "Checkmate — White wins"
or "Checkmate — Black wins" names the winner. "Stalemate" or "Draw"
means neither player has won. The verdict is computed from the position
and displayed; it is always definite. Checkmate is reachable — Glinski's
hexagonal chess has been played to decisive results for decades — so the
game always terminates in one of the announcements above.

## The interface

Move by dragging a piece to a highlighted destination, or by clicking a
piece and then clicking a destination. When a piece is selected, its
legal destinations are marked: empty destinations are shaded, and a cell
you can capture on is ringed. **New game** starts over; **Undo** takes
back the most recent move by agreement of the players. The game is local:
both players share one screen.

**Forced moves.** When the player to move has exactly one legal move,
that move executes automatically after a short delay, with no
announcement. It appears in the move list identically to a hand-played
move. The delay is a decaying floor: the first auto-execution in a game
waits 800 ms, and each subsequent auto-execution waits 50 ms less than
the one before, down to 0 ms — reached after sixteen consecutive
auto-executions and held there for every one after. The countdown runs
down across the whole game session and across both players; it is never
displayed. Because a whole sequence can consist of successive forced
positions, this may advance several moves in a row without any input,
each a little faster than the last. Auto-execution never changes which
move is legal or how the game ends; it only removes the wait when there
is no choice to make. If **Undo** returns the game to a position where
the side to move still has only one legal move, that move executes again
after the current delay. The guarantee holds however the forced position
is reached — by ordinary play, by **Undo**, or by editing the move list
(below): whenever the side to move has exactly one legal move, that move
executes after the current delay. **New game** starts a fresh decay
sequence, restoring the delay to 800 ms.

**The move list.** Each move is recorded in this version's coordinate
notation — the piece letter (none for a pawn) followed by the destination
cell, with `x` for a capture and `=Q`/`=R`/`=B`/`=N` for a promotion.
Each entry in the list is editable in place, a carry-over from the square
version. Editing replays the list from the start; because the notation
here is hexagonal rather than standard algebraic, an edited entry that the
replayer cannot interpret — and every entry after it — is struck through
as unreachable, and the board shows the last position actually reached.
Playing by pointer, rather than by editing the list, is the reliable way
to reach a position in this version. A game whose move list has been
edited is not saved across a page reload. Editing the list replays the
moves *without* applying the renaming rotation, so immediately after an
edit the board shows the un-renamed types; renaming resumes on the next
move played by pointer. Reaching a position by ordinary play, where each
arrival is renamed, is the way to see this version as intended.
