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
推送于2023-12-13 15:31:34
最后一次提交2022-08-22 10:01:47
发布数11
最新版本名称v1.0.10 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数5
关注者数2
派生数0
提交数87
已启用问题?
问题数2
打开的问题数1
拉请求数6
打开的拉请求数3
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?