Documentation
¶
Overview ¶
Package reversi is a pure-Go Reversi (Othello) rules engine — no protocol, no I/O, standard library only.
Extracted from https://github.com/richardwooding/kibitz
Sides are +1 (Black, P1, moves first) and -1 (White, P2). Passes are a pure function of the position, so they are COMPUTED by Advance and never sent over the wire — a pass message would only be a desync surface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIllegalPlace = errors.New("reversi: illegal placement")
Functions ¶
func Advance ¶
Advance decides who moves after side just moved: the opponent if it has a move; otherwise the mover again (a computed pass); otherwise the game is over (covers two-pass and full-board endings identically).
func LegalSquares ¶
LegalSquares lists every square where side may place.
Types ¶
Click to show internal directories.
Click to hide internal directories.