octad

为 lioctad.org 编写的 Octad 游戏库。「Octad game library written in go for lioctad.org」

Github stars Tracking Chart

octad

GoDoc
Go Report Card
License

octad is a set of go packages which provide common octad chess variant
utilities such as move generation, turn management, checkmate detection,
a basic engine, PGN encoding, image generation, and others.

octad can be installed using "go get".

go get -u github.com/dechristopher/octad

Octad Game

Octad was conceived by Andrew DeChristopher in 2018. Rules and information about
the game can be found below. Octad is thought to be a solved, deterministic game
but needs formal verification to prove that. This repository exists as an effort
towards that goal.

Board Layout

Each player begins with four pieces: a knight, their king, and two pawns placed
in that order from left to right relative to them. An example of this can be
seen in the board diagrams below:, Octad Board, 1. c2, 1. c2 b3, 1. c2 b3 2. cxb3! ..., -----------, -----, --------, ---------------------, Octad board, Octad board, Octad board, Octad board, ### Rules
All standard chess rules apply:

  • En passant is allowed
  • Pawn promotion to any piece
  • Stalemates are a draw

The only catch, however, is that castling is possible between the king and any
of its pieces on the starting rank before movement. The king will simply switch
spaces with the castling piece in all cases except the far pawn, in which case
the king will travel one space to the right, and the pawn will lie where the
king was before. An example of white castling with their far pawn can be
expressed as [ 1. c2 b3 2. O-O-O ... ] with the resulting structure leaving
the knight on a1, a pawn on b1, the king on c1, and the other pawn on c2. Here
is what that would look like on the board:

Octad board

Castling Notation

  • Knight castle: O
  • Close pawn castle: O-O
  • Far pawn castle: O-O-O

OFEN Notation

OFEN is a derivation of FEN to support the features of Octad. Read more
here.

Sample Games

1.O-O a3
2.Nc2 a2
3.b3+ Nxb3+
4.Kb2 a1=Q+
5.Nxa1 Nxa1
6.Kxa1 Kc3
7.Ka2 b3+
8.Ka1 b2+
9.Kb1 Kb3
10.d3 Kc3
11.d4=Q+ Kxd4
12.Kxb2 1/2-1/2

Drawn by Insufficient Material
1.c2 b3
2.Kb2 O-O-O
3.cxb3 cxb3
4.d2 Nc2
5.d3 Nxa1
6.d4=Q# 1-0

White wins by Checkmate

Performance

octad has been performance tuned, using
pprof, with the goal of being fast
enough for use by octad bots and engines. This implementation relies heavily
on the use of bitboards,
resulting in very solid computational performance.

Benchmarks

The benchmarks can be run with the following command:

go test -bench=.

Results from the baseline 2019 16" MBP:

BenchmarkBitboardReverse-12           	1000000000     0.000016 ns/op
BenchmarkStalemateStatus-12           	971688	       1220 ns/op
BenchmarkInvalidStalemateStatus-12    	1387780	       857 ns/op
BenchmarkPositionHash-12              	1429471	       841 ns/op
BenchmarkValidMoves-12                	235640	       4992 ns/op

Main metrics

Overview
Name With Ownerdechristopher/octad
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2021-02-16 18:06:49
Pushed At2023-12-13 15:31:34
Last Commit At2022-08-22 10:01:47
Release Count11
Last Release Namev1.0.10 (Posted on )
First Release Namev1.0.0 (Posted on )
用户参与
Stargazers Count5
Watchers Count2
Fork Count0
Commits Count87
Has Issues Enabled
Issues Count2
Issue Open Count1
Pull Requests Count6
Pull Requests Open Count3
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private