Skip to content

Repository files navigation

About the Game Hnefatafl (Tafl) is a Scandinavian board game. The first mentions date back to the III century A.D. Later Vikings brought it to Greenland, Iceland, Wales, Britain, and probably to Kievan Rus. With the spread of chess in Scandinavia (X-XI centuries) this game was forgotten.

About the repository Realization of the library with the rules of the game hnefatafl, as well as a console version of the game that uses this library. To track the state of the game, a notation similar to Fen's notation in chess is used.

Unity Package Install via Package Manager → Add package from git URL:

https://github.com/Dimidril/Hnefatafl.git?path=/Hnefatafl

Pinned version (git tag):

https://github.com/Dimidril/Hnefatafl.git?path=/Hnefatafl#v1.0.0

Then use using Hnefatafl; in your scripts.

Starting a game

var game = new Game();                      // GameRules.Default
var fetlar = new Game(GameRules.Fetlar);
var alea = new Game(GameRules.AleaEvangelii);
var custom = new Game(GameRules.Tablut.With(kingArmed: false));

Presets

Preset Board King escape Capture Armed Notes
Default 11×11 Corners 4 No Legacy behavior
Fetlar 11×11 Corners 4 Yes Encircle, draw forts, repetition draw
Copenhagen 11×11 Corners + exit fort 4 Yes Shieldwall, encircle
OldHnefatafl 11×11 Corners 4 Yes King capturable on edge
York 11×11 Any edge 4 No Unarmed king
Berserk 11×11 Corners 4 Yes Multi-capture turns
Tablut 9×9 Any edge 2 Yes Historical-style
SeaBattle 9×9 Any edge 4 No Unarmed “cargo” king
SimpleTafl 9×9 Any edge 2 Yes No restricted squares
Brandubh 7×7 Corners 2 Yes Irish
ArdRi 7×7 Any edge 2 Yes No throne
Gokstad 13×13 Corners 4 Yes Closed serif-cross
AleaEvangelii 19×19 2×2 citadel 4 Yes CornerBaseWidth=2

Customize with With(...) (throne/corner access, hostility, berserk, no-legal-moves, etc.).

Console

dotnet run --project HnefaatflTestConsole -- Fetlar
dotnet run --project HnefaatflTestConsole -- AleaEvangelii
dotnet run --project HnefaatflTestConsole -- Berserk

Об игре Хнефатафл (Тафл) — скандинавская настольная игра. Первые упоминания относятся к III веку н. э.

О репозитории Библиотека правил хнефатафл и консольный клиент. Состояние — FEN-подобная нотация.

Запуск

var game = new Game(GameRules.Copenhagen);
var custom = new Game(GameRules.ArdRi.With(kingArmed: false));

Пресеты: Default, Fetlar, Copenhagen, OldHnefatafl, York, Berserk, Tablut, SeaBattle, SimpleTafl, Brandubh, ArdRi, Gokstad, AleaEvangelii.

About

Hnefatafl liblary

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages