chess

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitboard

type Bitboard uint64
const (
	BbLight Bitboard = 0xaa55aa55aa55aa55
	BbDark  Bitboard = 0x55aa55aa55aa55aa
)
const (
	BbEmpty Bitboard = 0
	BbFull  Bitboard = math.MaxUint64
)

func BbAntidiag

func BbAntidiag(d int) Bitboard

func BbDiag

func BbDiag(d int) Bitboard

func BbFile

func BbFile(f File) Bitboard

func BbRank

func BbRank(r Rank) Bitboard

func BitboardFromCoord

func BitboardFromCoord(c Coord) Bitboard

func (Bitboard) DepositBits

func (b Bitboard) DepositBits(x uint64) Bitboard

func (Bitboard) GetFirst

func (b Bitboard) GetFirst() Coord

func (Bitboard) Has

func (b Bitboard) Has(c Coord) bool

func (Bitboard) Has2

func (b Bitboard) Has2(f File, r Rank) bool

func (Bitboard) IsEmpty

func (b Bitboard) IsEmpty() bool

func (Bitboard) Len

func (b Bitboard) Len() int

func (*Bitboard) Next

func (b *Bitboard) Next() Coord

func (*Bitboard) Set

func (b *Bitboard) Set(c Coord)

func (Bitboard) String

func (b Bitboard) String() string

func (*Bitboard) Unset

func (b *Bitboard) Unset(c Coord)

func (Bitboard) With

func (b Bitboard) With(c Coord) Bitboard

func (Bitboard) With2

func (b Bitboard) With2(f File, r Rank) Bitboard

func (Bitboard) Without

func (b Bitboard) Without(c Coord) Bitboard

func (Bitboard) Without2

func (b Bitboard) Without2(f File, r Rank) Bitboard

type Board

type Board struct {
	// contains filtered or unexported fields
}

func BoardFromFEN

func BoardFromFEN(fen string) (*Board, error)

func InitialBoard

func InitialBoard() *Board

func NewBoard

func NewBoard(r RawBoard) (*Board, error)

func (*Board) BbCell

func (b *Board) BbCell(c Cell) Bitboard

func (*Board) BbColor

func (b *Board) BbColor(c Color) Bitboard

func (*Board) BbPiece

func (b *Board) BbPiece(c Color, p Piece) Bitboard

func (*Board) CalcOutcome

func (b *Board) CalcOutcome() Outcome

func (*Board) Castling

func (b *Board) Castling() CastlingRights

func (*Board) CellAttackers

func (b *Board) CellAttackers(coord Coord, c Color) Bitboard

func (*Board) Checkers

func (b *Board) Checkers() Bitboard

func (*Board) Clone

func (b *Board) Clone() *Board

func (*Board) EpDest

func (b *Board) EpDest() MaybeCoord

func (*Board) EpSource

func (b *Board) EpSource() MaybeCoord

func (*Board) Eq

func (b *Board) Eq(o *Board) bool

func (*Board) FEN

func (b *Board) FEN() string

func (*Board) GenLegalMoves

func (b *Board) GenLegalMoves(preset MoveGenPreset, res []Move) []Move

func (*Board) GenSemilegalMoves

func (b *Board) GenSemilegalMoves(preset MoveGenPreset, res []Move) []Move

func (*Board) Get

func (b *Board) Get(c Coord) Cell

func (*Board) Get2

func (b *Board) Get2(f File, r Rank) Cell

func (*Board) HasLegalMoves

func (b *Board) HasLegalMoves() bool

func (*Board) IsCellAttacked

func (b *Board) IsCellAttacked(coord Coord, c Color) bool

func (*Board) IsCheck

func (b *Board) IsCheck() bool

func (*Board) IsInsufficientMaterial

func (b *Board) IsInsufficientMaterial() bool

func (*Board) KingPos

func (b *Board) KingPos(c Color) Coord

func (*Board) MakeLegalMove

func (b *Board) MakeLegalMove(mv Move) Undo

func (*Board) MakeMove

func (b *Board) MakeMove(mv Move) (Undo, error)

func (*Board) MakeMoveSAN

func (b *Board) MakeMoveSAN(s string) (Undo, error)

func (*Board) MakeMoveUCI

func (b *Board) MakeMoveUCI(s string) (Undo, error)

func (*Board) MakeSemilegalMove

func (b *Board) MakeSemilegalMove(mv Move) (Undo, bool)

func (*Board) MakeUCIMove

func (b *Board) MakeUCIMove(um UCIMove) (Undo, error)

func (*Board) MarshalJSON added in v0.9.1

func (b *Board) MarshalJSON() ([]byte, error)

func (*Board) MoveCounter

func (b *Board) MoveCounter() uint8

func (*Board) MoveNumber

func (b *Board) MoveNumber() uint32

func (*Board) Pretty

func (b *Board) Pretty(style PrettyStyle) string

func (*Board) Raw

func (b *Board) Raw() RawBoard

func (*Board) Side

func (b *Board) Side() Color

func (*Board) String

func (b *Board) String() string

func (*Board) UnmakeMove

func (b *Board) UnmakeMove(u Undo)

func (*Board) UnmarshalJSON added in v0.9.1

func (b *Board) UnmarshalJSON(data []byte) error

func (*Board) ZHash

func (b *Board) ZHash() ZHash

type CastlingRights

type CastlingRights uint8
const (
	CastlingRightsEmpty CastlingRights = 0
	CastlingRightsFull  CastlingRights = 15
	CastlingRightsMax   CastlingRights = CastlingRightsFull + 1
)

func CastlingRightsFromString

func CastlingRightsFromString(s string) (CastlingRights, error)

func (CastlingRights) Has

func (r CastlingRights) Has(c Color, s CastlingSide) bool

func (CastlingRights) HasColor

func (r CastlingRights) HasColor(c Color) bool

func (CastlingRights) IsValid

func (r CastlingRights) IsValid() bool

func (CastlingRights) MarshalJSON added in v0.9.1

func (r CastlingRights) MarshalJSON() ([]byte, error)

func (*CastlingRights) Set

func (r *CastlingRights) Set(c Color, s CastlingSide)

func (CastlingRights) String

func (r CastlingRights) String() string

func (*CastlingRights) UnmarshalJSON added in v0.9.1

func (r *CastlingRights) UnmarshalJSON(data []byte) error

func (*CastlingRights) Unset

func (r *CastlingRights) Unset(c Color, s CastlingSide)

func (*CastlingRights) UnsetColor

func (r *CastlingRights) UnsetColor(c Color)

func (CastlingRights) With

func (CastlingRights) Without

type CastlingSide

type CastlingSide uint8
const (
	CastlingQueenside CastlingSide = iota
	CastlingKingside
	CastlingSideMax
)

func (CastlingSide) IsValid

func (s CastlingSide) IsValid() bool

type Cell

type Cell uint8
const (
	CellEmpty Cell = iota
	CellWhitePawn
	CellWhiteKing
	CellWhiteKnight
	CellWhiteBishop
	CellWhiteRook
	CellWhiteQueen
	CellBlackPawn
	CellBlackKing
	CellBlackKnight
	CellBlackBishop
	CellBlackRook
	CellBlackQueen
	CellMax
)

func CellFromByte

func CellFromByte(b byte) (Cell, error)

func CellFromParts

func CellFromParts(c Color, p Piece) Cell

func CellFromString

func CellFromString(s string) (Cell, error)

func (Cell) Color

func (c Cell) Color() (Color, bool)

func (Cell) HasColor

func (c Cell) HasColor(co Color) bool

func (Cell) IsFree

func (c Cell) IsFree() bool

func (Cell) IsOccupied

func (c Cell) IsOccupied() bool

func (Cell) IsValid

func (c Cell) IsValid() bool

func (Cell) MarshalJSON added in v0.9.1

func (c Cell) MarshalJSON() ([]byte, error)

func (Cell) Piece

func (c Cell) Piece() (Piece, bool)

func (Cell) String

func (c Cell) String() string

func (Cell) ToByte

func (c Cell) ToByte() byte

func (Cell) ToRune

func (c Cell) ToRune() rune

func (*Cell) UnmarshalJSON added in v0.9.1

func (c *Cell) UnmarshalJSON(data []byte) error

type Color

type Color uint8
const (
	ColorWhite Color = iota
	ColorBlack
	ColorMax
)

func ColorFromByte

func ColorFromByte(b byte) (Color, error)

func ColorFromString

func ColorFromString(s string) (Color, error)

func (Color) Inv

func (c Color) Inv() Color

func (Color) IsValid

func (c Color) IsValid() bool

func (Color) LongString

func (c Color) LongString() string

func (Color) MarshalJSON added in v0.9.1

func (c Color) MarshalJSON() ([]byte, error)

func (Color) String

func (c Color) String() string

func (Color) ToByte

func (c Color) ToByte() byte

func (*Color) UnmarshalJSON added in v0.9.1

func (c *Color) UnmarshalJSON(data []byte) error

type Coord

type Coord uint8
const CoordMax Coord = 64

func CoordFromParts

func CoordFromParts(f File, r Rank) Coord

func CoordFromString

func CoordFromString(s string) (Coord, error)

func (Coord) Add

func (c Coord) Add(delta int8) Coord

func (Coord) Antidiag

func (c Coord) Antidiag() int

func (Coord) Diag

func (c Coord) Diag() int

func (Coord) File

func (c Coord) File() File

func (Coord) IsValid

func (c Coord) IsValid() bool

func (Coord) MarshalJSON added in v0.9.1

func (c Coord) MarshalJSON() ([]byte, error)

func (Coord) Rank

func (c Coord) Rank() Rank

func (Coord) Shift

func (c Coord) Shift(d CoordDelta) MaybeCoord

func (Coord) String

func (c Coord) String() string

func (*Coord) UnmarshalJSON added in v0.9.1

func (c *Coord) UnmarshalJSON(data []byte) error

type CoordDelta

type CoordDelta struct {
	File int8
	Rank int8
}

type File

type File uint8
const (
	FileA File = iota
	FileB
	FileC
	FileD
	FileE
	FileF
	FileG
	FileH
	FileMax
)

func FileFromByte

func FileFromByte(b byte) (File, error)

func (File) IsValid

func (f File) IsValid() bool

func (File) String

func (f File) String() string

func (File) ToByte

func (f File) ToByte() byte

type Game

type Game struct {
	// contains filtered or unexported fields
}

func GameFromUCIList

func GameFromUCIList(b *Board, ucis string) (*Game, error)

func NewGame

func NewGame() *Game

func NewGameWithFEN

func NewGameWithFEN(fen string) (*Game, error)

func NewGameWithPosition

func NewGameWithPosition(b *Board) *Game

func (*Game) CalcOutcome

func (g *Game) CalcOutcome() Outcome

func (*Game) ClearOutcome

func (g *Game) ClearOutcome()

func (*Game) Clone

func (g *Game) Clone() *Game

func (*Game) CurBoard

func (g *Game) CurBoard() *Board

The board updates automatically after calls to Push...() or Pop().

Do not mutate the returned board.

func (*Game) CurPos

func (g *Game) CurPos() RawBoard

func (*Game) Eq

func (g *Game) Eq(o *Game) bool

func (*Game) IsEmpty

func (g *Game) IsEmpty() bool

func (*Game) IsFinished

func (g *Game) IsFinished() bool

func (*Game) Len

func (g *Game) Len() int

func (*Game) MoveAt

func (g *Game) MoveAt(index int) Move

func (*Game) Outcome

func (g *Game) Outcome() Outcome

func (*Game) Pop

func (g *Game) Pop() (Move, bool)

func (*Game) PushLegalMove

func (g *Game) PushLegalMove(mv Move)

func (*Game) PushMove

func (g *Game) PushMove(mv Move) error

func (*Game) PushMoveSAN

func (g *Game) PushMoveSAN(s string) error

func (*Game) PushMoveUCI

func (g *Game) PushMoveUCI(s string) error

func (*Game) PushSemilegalMove

func (g *Game) PushSemilegalMove(mv Move) bool

func (*Game) PushUCIList

func (g *Game) PushUCIList(ucis string) (int, error)

func (*Game) PushUCIMove

func (g *Game) PushUCIMove(um UCIMove) error

func (*Game) SetAutoOutcome

func (g *Game) SetAutoOutcome(filter VerdictFilter) Outcome

func (*Game) SetOutcome

func (g *Game) SetOutcome(o Outcome)

func (*Game) StartPos

func (g *Game) StartPos() RawBoard

func (*Game) Styled

func (g *Game) Styled(style GameStyle) (string, error)

func (*Game) StyledExt

func (g *Game) StyledExt(style GameStyle, ga GameAnnotations) (string, error)

func (*Game) UCIList

func (g *Game) UCIList() string

func (*Game) Walk

func (g *Game) Walk() Walker

type GameAnnotations

type GameAnnotations struct {
	Comments [][]string
}

type GameOutcomeStyle

type GameOutcomeStyle uint8
const (
	GameOutcomeHide GameOutcomeStyle = iota
	GameOutcomeFinishedOnly
	GameOutcomeShow
)

type GameStyle

type GameStyle struct {
	Move       MoveStyle
	MoveNumber MoveNumberStyle
	Outcome    GameOutcomeStyle
}

type MaybeCoord

type MaybeCoord uint8
const NoCoord MaybeCoord = 255

func MaybeCoordFromString

func MaybeCoordFromString(s string) (MaybeCoord, error)

func SomeCoord

func SomeCoord(c Coord) MaybeCoord

func (MaybeCoord) ForceGet

func (c MaybeCoord) ForceGet() Coord

func (MaybeCoord) IsNone

func (c MaybeCoord) IsNone() bool

func (MaybeCoord) IsSome

func (c MaybeCoord) IsSome() bool

func (MaybeCoord) IsValid

func (c MaybeCoord) IsValid() bool

func (MaybeCoord) MarshalJSON added in v0.9.1

func (c MaybeCoord) MarshalJSON() ([]byte, error)

func (MaybeCoord) String

func (c MaybeCoord) String() string

func (MaybeCoord) TryGet

func (c MaybeCoord) TryGet() (Coord, bool)

func (*MaybeCoord) UnmarshalJSON added in v0.9.1

func (c *MaybeCoord) UnmarshalJSON(data []byte) error

type Move

type Move struct {
	// contains filtered or unexported fields
}

func LegalMoveFromSAN

func LegalMoveFromSAN(s string, b *Board) (Move, error)

func LegalMoveFromUCI

func LegalMoveFromUCI(s string, b *Board) (Move, error)

func LegalMoveFromUCIMove

func LegalMoveFromUCIMove(u UCIMove, b *Board) (Move, error)

func MoveFromCastling

func MoveFromCastling(c Color, s CastlingSide) Move

func MoveFromUCI

func MoveFromUCI(s string, b *Board) (Move, error)

func MoveFromUCIMove

func MoveFromUCIMove(u UCIMove, b *Board) (Move, error)

func NewMove

func NewMove(kind MoveKind, srcCell Cell, src, dst Coord) (Move, error)

func NewMoveUnchecked

func NewMoveUnchecked(kind MoveKind, srcCell Cell, src, dst Coord) Move

func NullMove

func NullMove() Move

func SemilegalMoveFromUCI

func SemilegalMoveFromUCI(s string, b *Board) (Move, error)

func SemilegalMoveFromUCIMove

func SemilegalMoveFromUCIMove(u UCIMove, b *Board) (Move, error)

func (Move) Dst

func (m Move) Dst() Coord

func (Move) IsLegalWhenSemilegal

func (m Move) IsLegalWhenSemilegal(b *Board) bool

func (Move) IsWellFormed

func (m Move) IsWellFormed() bool

func (Move) Kind

func (m Move) Kind() MoveKind

func (Move) SemiValidate

func (m Move) SemiValidate(b *Board) error

func (Move) Src

func (m Move) Src() Coord

func (Move) SrcCell

func (m Move) SrcCell() Cell

func (Move) String

func (m Move) String() string

func (Move) Styled

func (m Move) Styled(b *Board, style MoveStyle) (string, error)

func (Move) UCI

func (m Move) UCI() string

func (Move) UCIMove

func (m Move) UCIMove() UCIMove

func (Move) Validate

func (m Move) Validate(b *Board) error

type MoveGenPreset

type MoveGenPreset uint8
const (
	MoveGenAll MoveGenPreset = iota
	MoveGenCapture
	MoveGenSimple
	MoveGenSimpleNoPromote
	MoveGenSimplePromote
	MoveGenPresetMax
)

type MoveKind

type MoveKind uint8
const (
	MoveNull MoveKind = iota
	MoveSimple
	MoveCastlingQueenside
	MoveCastlingKingside
	MovePawnDouble
	MoveEnpassant
	MovePromoteKnight
	MovePromoteBishop
	MovePromoteRook
	MovePromoteQueen
	MoveKindMax
)

func MoveKindFromCastlingSide

func MoveKindFromCastlingSide(s CastlingSide) MoveKind

func MoveKindFromPromote

func MoveKindFromPromote(p Piece) (MoveKind, bool)

func (MoveKind) CastlingSide

func (k MoveKind) CastlingSide() (CastlingSide, bool)

func (MoveKind) IsValid

func (k MoveKind) IsValid() bool

func (MoveKind) MatchesPiece

func (k MoveKind) MatchesPiece(p Piece) bool

func (MoveKind) Promote

func (k MoveKind) Promote() (Piece, bool)

type MoveNumberStyle

type MoveNumberStyle struct {
	Enabled         bool
	Custom          bool
	CustomStartFrom int
}

type MoveStyle

type MoveStyle uint8
const (
	MoveStyleSAN MoveStyle = iota
	MoveStyleFancySAN
	MoveStyleUCI
)

type Outcome

type Outcome struct {
	// contains filtered or unexported fields
}

func DrawOutcome

func DrawOutcome(verdict Verdict) (Outcome, bool)

func MustDrawOutcome

func MustDrawOutcome(verdict Verdict) Outcome

func MustWinOutcome

func MustWinOutcome(verdict Verdict, side Color) Outcome

func NewOutcome

func NewOutcome(verdict Verdict, side Color) Outcome

func RunningOutcome

func RunningOutcome() Outcome

func WinOutcome

func WinOutcome(verdict Verdict, side Color) (Outcome, bool)

func (Outcome) IsFinished

func (o Outcome) IsFinished() bool

func (Outcome) Passes

func (o Outcome) Passes(filter VerdictFilter) bool

func (Outcome) Side

func (o Outcome) Side() (Color, bool)

func (Outcome) Status

func (o Outcome) Status() Status

func (Outcome) String

func (o Outcome) String() string

func (Outcome) Verdict

func (o Outcome) Verdict() Verdict

type Piece

type Piece uint8
const (
	PiecePawn Piece = iota
	PieceKing
	PieceKnight
	PieceBishop
	PieceRook
	PieceQueen
	PieceMax
)

func PieceFromByte

func PieceFromByte(b byte) (Piece, error)

func PieceFromString

func PieceFromString(s string) (Piece, error)

func (Piece) IsValid

func (p Piece) IsValid() bool

func (Piece) String

func (p Piece) String() string

func (Piece) ToByte

func (p Piece) ToByte() byte

type PrettyStyle

type PrettyStyle uint8
const (
	PrettyStyleASCII PrettyStyle = iota
	PrettyStyleFancy
)

type Rank

type Rank uint8
const (
	Rank8 Rank = iota
	Rank7
	Rank6
	Rank5
	Rank4
	Rank3
	Rank2
	Rank1
	RankMax
)

func RankFromByte

func RankFromByte(b byte) (Rank, error)

func (Rank) IsValid

func (r Rank) IsValid() bool

func (Rank) String

func (r Rank) String() string

func (Rank) ToByte

func (r Rank) ToByte() byte

type RawBoard

type RawBoard struct {
	Cells       [CoordMax]Cell
	Side        Color
	Castling    CastlingRights
	EpSource    MaybeCoord
	MoveCounter uint8
	MoveNumber  uint32
}

func InitialRawBoard

func InitialRawBoard() RawBoard

func RawBoardFromFEN

func RawBoardFromFEN(fen string) (RawBoard, error)

func (*RawBoard) EpDest

func (b *RawBoard) EpDest() MaybeCoord

func (RawBoard) FEN

func (b RawBoard) FEN() string

func (*RawBoard) Get

func (b *RawBoard) Get(c Coord) Cell

func (*RawBoard) Get2

func (b *RawBoard) Get2(f File, r Rank) Cell

func (RawBoard) MarshalJSON added in v0.9.1

func (b RawBoard) MarshalJSON() ([]byte, error)

func (*RawBoard) Pretty

func (b *RawBoard) Pretty(style PrettyStyle) string

func (*RawBoard) Put

func (b *RawBoard) Put(c Coord, ce Cell)

func (*RawBoard) Put2

func (b *RawBoard) Put2(f File, r Rank, ce Cell)

func (RawBoard) String

func (b RawBoard) String() string

func (*RawBoard) UnmarshalJSON added in v0.9.1

func (b *RawBoard) UnmarshalJSON(data []byte) error

func (*RawBoard) ZHash

func (b *RawBoard) ZHash() ZHash

type RepeatTable

type RepeatTable struct {
	// contains filtered or unexported fields
}

func NewRepeatTable

func NewRepeatTable() *RepeatTable

func (*RepeatTable) Clone

func (r *RepeatTable) Clone() *RepeatTable

func (*RepeatTable) Count

func (r *RepeatTable) Count(b *Board) int

func (*RepeatTable) Pop

func (r *RepeatTable) Pop(b *Board)

func (*RepeatTable) Push

func (r *RepeatTable) Push(b *Board)

type Status

type Status uint8
const (
	StatusRunning Status = iota
	StatusDraw
	StatusWhiteWins
	StatusBlackWins
)

func StatusFromString added in v0.9.1

func StatusFromString(s string) (Status, error)

func StatusWin

func StatusWin(c Color) Status

func (Status) IsFinished

func (s Status) IsFinished() bool

func (Status) MarshalJSON added in v0.9.1

func (s Status) MarshalJSON() ([]byte, error)

func (Status) String

func (s Status) String() string

func (*Status) UnmarshalJSON added in v0.9.1

func (s *Status) UnmarshalJSON(data []byte) error

func (Status) Winner

func (s Status) Winner() (Color, bool)

type UCIMove

type UCIMove struct {
	// contains filtered or unexported fields
}

func NullUCIMove

func NullUCIMove() UCIMove

func PromoteUCIMove

func PromoteUCIMove(src, dst Coord, promote Piece) UCIMove

func SimpleUCIMove

func SimpleUCIMove(src, dst Coord) UCIMove

func UCIMoveFromString

func UCIMoveFromString(s string) (UCIMove, error)

func (UCIMove) Dst

func (m UCIMove) Dst() Coord

func (UCIMove) Kind

func (m UCIMove) Kind() UCIMoveKind

func (UCIMove) MarshalJSON added in v0.9.1

func (m UCIMove) MarshalJSON() ([]byte, error)

func (UCIMove) Promote

func (m UCIMove) Promote() (Piece, bool)

func (UCIMove) Src

func (m UCIMove) Src() Coord

func (UCIMove) String

func (m UCIMove) String() string

func (UCIMove) ToMove

func (m UCIMove) ToMove(b *Board) (Move, error)

func (*UCIMove) UnmarshalJSON added in v0.9.1

func (m *UCIMove) UnmarshalJSON(data []byte) error

type UCIMoveKind

type UCIMoveKind uint8
const (
	UCIMoveNull UCIMoveKind = iota
	UCIMoveSimple
	UCIMovePromote
	UCIMoveKindMax
)

func (UCIMoveKind) IsValid

func (k UCIMoveKind) IsValid() bool

type Undo

type Undo struct {
	// contains filtered or unexported fields
}

func (Undo) Move

func (u Undo) Move() Move

type Verdict

type Verdict uint8
const (
	// Running game verdicts
	VerdictRunning Verdict = 0

	// Draw game verdicts
	VerdictDrawUnknown          Verdict = 32
	VerdictStalemate            Verdict = 33
	VerdictInsufficientMaterial Verdict = 34
	VerdictMoves75              Verdict = 35
	VerdictRepeat5              Verdict = 36
	VerdictMoves50              Verdict = 37
	VerdictRepeat3              Verdict = 38
	VerdictDrawAgreement        Verdict = 39

	// Win game verdicts
	VerdictWinUnknown      Verdict = 64
	VerdictCheckmate       Verdict = 65
	VerdictTimeForfeit     Verdict = 66
	VerdictInvalidMove     Verdict = 67
	VerdictEngineError     Verdict = 68
	VerdictResign          Verdict = 69
	VerdictOpponentAbandon Verdict = 70
)

func (Verdict) IsFinished

func (v Verdict) IsFinished() bool

func (Verdict) Kind

func (v Verdict) Kind() VerdictKind

func (Verdict) Passes

func (v Verdict) Passes(filter VerdictFilter) bool

func (Verdict) String

func (v Verdict) String() string

type VerdictFilter

type VerdictFilter uint8
const (
	VerdictFilterForce VerdictFilter = iota
	VerdictFilterStrict
	VerdictFilterRelaxed
)

type VerdictKind

type VerdictKind uint8
const (
	VerdictKindRunning VerdictKind = 0
	VerdictKindDraw    VerdictKind = 1
	VerdictKindWin     VerdictKind = 2
)

type Walker

type Walker struct {
	// contains filtered or unexported fields
}

func (*Walker) Board

func (w *Walker) Board() *Board

The board updates automatically after call to Next(), Prev(), First(), Last() or Jump().

Do not mutate the returned board.

func (*Walker) First

func (w *Walker) First()

func (*Walker) IsEmpty

func (w *Walker) IsEmpty() bool

func (*Walker) Jump

func (w *Walker) Jump(pos int) bool

func (*Walker) Last

func (w *Walker) Last()

func (*Walker) Len

func (w *Walker) Len() int

func (*Walker) Next

func (w *Walker) Next() bool

func (*Walker) Pos

func (w *Walker) Pos() int

func (*Walker) Prev

func (w *Walker) Prev() bool

type ZHash

type ZHash [1]uint64

func (ZHash) Xor

func (z ZHash) Xor(o ZHash) ZHash

func (*ZHash) XorEq

func (z *ZHash) XorEq(o ZHash)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL