Purvakalpa Studio

Docs / Chess: Knight Fever

Endless: chess on a Möbius strip

How Endless glues the a-file to the h-file with a half-twist, and how a flat 16-wide cylinder keeps move generation, check and mate free of seam special cases.

Endless is ordinary chess on an unusual board. Every rule is the normal one, including castling, en passant, promotion, check and mate. Only the geometry changes: the board is a Möbius strip, so it has no left or right edge.

The geometry

Take an 8x8 board and glue the a-file to the h-file with a half-twist, the way the ends of a Möbius strip join.

  • A piece that leaves one side comes back on the other, on the mirrored rank. Crossing the seam turns rank r into rank 9 minus r: rank 3 becomes rank 6, and rank 1 becomes rank 8.
  • The top and bottom edges stay edges. Ranks 1 and 8 are where they always were, so the starting position and promotion are standard.

That one rule has visible consequences:

  • Rooks sweep two ranks. A horizontal line no longer stops at the edge; it carries on along the mirrored rank, as the worked example below shows.
  • Bishops bend at the seam. A bishop leaving h3 towards the top right re-enters on a5 and carries on downwards through b4, c3 and d2 to e1.
  • Move one already has captures. The rook on a1 sits next to the rook on h8 across the seam. White starts with 24 legal moves instead of 20: the usual 20, plus four captures across the seam (a1 takes h8, b1 takes h7, g1 takes a7 and h1 takes a8).
  • Knights keep their colour across the seam. On a flat board a knight always lands on the opposite colour. A jump that crosses the seam, such as b1 to h7, lands on the same colour. That is a property of the geometry, not a bug.

Why the board is not bent

Writing the seam into the rules would mean special cases in every piece’s moves and in check and mate detection, each one a place to get the twist wrong. Knight Fever does not bend the board. It doubles it.

The game runs on a flat cylinder 16 columns wide and 8 ranks tall. Columns wrap at 16, and the cylinder has no twist anywhere. Columns 0 to 7 are the board as printed (sheet A); columns 8 to 15 are the same board again with its ranks mirrored (sheet B):

column   0  1  2  3  4  5  6  7 | 8  9  10 11 12 13 14 15 | 0 ...
file     a  b  c  d  e  f  g  h | a  b  c  d  e  f  g  h  | a ...
rank     r (as printed)         | 9 - r (mirrored)        | r ...

Every square of the real board appears twice on the cylinder, once on each sheet: the strip’s orientation double cover. Pieces move on the cylinder exactly as on an ordinary board, and every destination is projected back onto the 8x8 board:

column c (taken mod 16), rank r
  c = 0 to 7    ->  square at file c,     rank r
  c = 8 to 15   ->  square at file c - 8, rank 9 - r

The half-twist lives entirely in that projection. Move generation, check and checkmate all go through it, so every piece behaves correctly at the seam without a single seam-specific rule.

Worked example: a rook on h3

A rook stands on h3, which is column 7 on sheet A, and the rest of its rank is empty. It slides to the right:

StepColumnSheetSquare
Start7Ah3
18Ba6 (file 8 - 8 = a, rank 9 - 3 = 6)
29Bb6
3 to 710 to 14Bc6 to g6
815Bh6
916, which wraps to 0Aa3
10 to 151 to 6Ab3 to g3

The next step would be column 7, h3 itself, so the line closes into a loop. On an empty line the rook reaches 15 squares: all of rank 6 and the rest of rank 3. Sliding left visits the same squares in the opposite order, g3 to a3 and then h6 back to a6.

The same rule explains the capture on move one. The rook on a1 is column 0. One step left is column 15, on sheet B: file 15 - 8 = h, rank 9 - 1 = 8. That is h8, where Black’s rook stands.

Playing Endless

On one device you can play a friend pass-and-play, play the bot, or watch the bot play itself. The bot is a negamax search inside MobiusEngine, the mode’s Swift engine.

  • Moves that cross the seam are marked with an arrow (↪), so a wrap never comes as a surprise.
  • You play on the 2D board. A draggable 3D view, built with SceneKit, shows the strip itself with the live position in your board colours. It is for looking, not moving.
  • A game can be replayed move by move.
  • Endless keeps one game in progress. It saves on the device after every move, resumes when you come back, and appears in Running Matches and under Jump back in on Home.

Endless over Wi-Fi

The host chooses Standard or Endless, and the variant reaches the joiner before roles are assigned, so both devices build the same board (see Wi-Fi play).

  • The host plays White and the joiner plays Black; the board flips for Black.
  • Each move travels as its from and to squares (0 to 63) plus any promotion piece. A received move is applied only if it came from the opponent’s device and both squares are on the board, and nobody can move out of turn.
  • Promotion is synced, Rematch resets both boards, the 2D and 3D views work as on one device, and a live readout shows the connection’s latency.

How it was checked

Endless began as a playable prototype whose engine was unit-tested on the projection, move reversibility, the 24-move opening count and mate detection. MobiusEngine is a full Swift port of that engine, with castling, promotion, en passant, check and mate, and its logic matches the prototype’s 16 passing tests.