octad

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

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者dechristopher/octad
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2021-02-16 18:06:49
推送於2025-10-07 16:41:41
最后一次提交2022-08-22 10:01:47
發布數11
最新版本名稱v1.0.10 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數5
關注者數1
派生數0
提交數87
已啟用問題?
問題數2
打開的問題數1
拉請求數6
打開的拉請求數4
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?