Implementation Log: Tablut
A record of implementing the Sámi tafl game 'Tablut' on the Parlourite engine. Covers the game overview, historical context, and implementation decisions.
I implemented Tablut on the Parlourite engine. This is a record of the work, created as the game is added to the public lineup.
About Tablut
Tablut is a board game recorded by the Swedish naturalist Linnaeus during his 1732 journey through Lapland. It belongs to the tafl family—asymmetric capture games that spread across Scandinavia, Iceland, and the British Isles.
The 9×9 board has a castle at the center. The defender starts with a king and 8 guard pieces surrounding the castle, while the attacker has 16 pieces positioned on the four sides. All pieces move like rooks in straight lines. Capturing works by flanking an enemy piece between two of your own.
The defender wins by escaping the king to the board’s edge. The attacker wins by capturing the king through flanking. However, the king is sturdier than regular pieces—near the castle, all four sides must be surrounded.
The tension between the defender breaking through with fewer pieces and the attacker tightening the net with numerical advantage creates a unique dynamic.
A Game of the Northern Peoples
Tafl games were widely played in Viking-age Scandinavia. Before chess spread to Europe, tafl was the intellectual board game of the northern peoples.
Linnaeus made his record in the Arctic Circle, among the Sámi people. During harsh winters with limited entertainment, this asymmetric battle must have been played repeatedly. The structure of siege and escape seems to reflect survival wisdom in the unforgiving northern environment.
Tafl declined as chess spread, but thanks to Linnaeus’s record, some rules survive today. The record is incomplete, however, leaving room for interpretation in reconstructions.
Reconstructed Rules
Linnaeus’s notes are brief, leaving several situations unspecified. Modern reconstructions vary among researchers.
This implementation adopts the reading that the king wins by reaching any edge square, not just corners. The corner-only reading (closer to older tafl variants) also exists, but the edge interpretation seems more natural from Linnaeus’s text.
Whether the king participates in captures (armed vs. unarmed) and whether the castle counts as hostile territory also vary by reconstruction. This implementation treats the king as armed and the castle as hostile.
Implementation Notes
Custodial capture seems simple but becomes tricky when conditions overlap.
The castle is a special entity. No one can stop on it or pass through it. Yet for capture purposes, it counts as a friendly piece for the attacker. When the king is adjacent to the castle, the attacker must block three sides and use the castle as the fourth.
The king’s handling was also complex. The king participates in captures (can flank as an ally) but has different capture conditions depending on position. Away from the castle, flanking with two pieces suffices; adjacent to the castle, all four sides must be surrounded. Writing this as a state machine helped organize the conditional logic.
Handling the no-moves situation required consideration. The reference allows passing to continue, but treating it as a loss feels more natural as a game. This implementation treats no-moves as a loss.
Verification involved visual inspection of 10 games, including king captures, king escapes, and no-moves endings, confirming legal moves and termination conditions.
Independent Decisions
For points not specified by the reconstruction or differing from the reference, the following decisions were made.
- The king wins by reaching any edge square (not corners only)
- The king is armed and can participate in captures
- The castle counts as hostile territory even when the king occupies it, counting toward the attacker’s encirclement
- No-moves results in a loss (not passing to continue)
Reflections
I imagine the scene Linnaeus witnessed in Lapland. In the Arctic winter, Sámi people gathered around a fire, playing out attacks and escapes on this board. The besiegers and the escapee—that structure perhaps overlaps with the wisdom of hunting and survival.
Before chess took its place, tafl held the seat of intellectual gaming in Scandinavia. It was fortunate that records survived. Incomplete though they are, an 18th-century naturalist’s curiosity saved this game.
Asymmetric games are interesting to implement. Attackers and defenders have different victory conditions; the pieces move the same way, but strategies differ entirely. Figuring out how to express that asymmetry in the engine was enjoyable.