Documentation ¶
Index ¶
- Constants
- Variables
- func AbsDelta(x, y int) int
- func AllBlackPawnAttacks(b uint64) uint64
- func AllWhitePawnAttacks(b uint64) uint64
- func BishopAttacks(from int, occ uint64) uint64
- func BitboardString(b uint64) string
- func Down(b uint64) uint64
- func DownFill(gen uint64) uint64
- func DownLeft(b uint64) uint64
- func DownRight(b uint64) uint64
- func File(sq int) int
- func FileDistance(sq1, sq2 int) int
- func FileFill(gen uint64) uint64
- func FirstOne(b uint64) int
- func FlipSquare(sq int) int
- func IsDarkSquare(sq int) bool
- func Left(b uint64) uint64
- func MakeSquare(file, rank int) int
- func Max(l, r int) int
- func Min(l, r int) int
- func MoreThanOne(value uint64) bool
- func ParseSquare(s string) int
- func PawnAttacks(from int, side bool) uint64
- func PawnAttacksNew(side, from int) uint64
- func PopCount(b uint64) int
- func QueenAttacks(from int, occ uint64) uint64
- func Rank(sq int) int
- func RankDistance(sq1, sq2 int) int
- func Right(b uint64) uint64
- func RookAttacks(from int, occ uint64) uint64
- func SquareDistance(sq1, sq2 int) int
- func SquareName(sq int) string
- func Up(b uint64) uint64
- func UpFill(gen uint64) uint64
- func UpLeft(b uint64) uint64
- func UpRight(b uint64) uint64
- type LimitsType
- type Move
- type OrderedMove
- type Position
- func (p *Position) AllPieces() uint64
- func (p *Position) Colours(side int) uint64
- func (p *Position) GenerateCaptures(ml []OrderedMove) []OrderedMove
- func (p *Position) GenerateLegalMoves() []Move
- func (p *Position) GenerateMoves(ml []OrderedMove) []OrderedMove
- func (p *Position) GetPieceTypeAndSide(sq int) (pieceType int, side bool)
- func (p *Position) IsCheck() bool
- func (p *Position) IsRepetition(other *Position) bool
- func (p *Position) KingSq(side bool) int
- func (src *Position) MakeMove(move Move, result *Position) bool
- func (p *Position) MakeMoveLAN(lan string) (Position, bool)
- func (src *Position) MakeNullMove(result *Position)
- func (p *Position) PiecesByColor(side bool) uint64
- func (p *Position) String() string
- func (p *Position) WhatPiece(sq int) int
- type SearchInfo
- type SearchParams
- type UciScore
Constants ¶
View Source
const ( FileAMask uint64 = 0x0101010101010101 << iota FileBMask FileCMask FileDMask FileEMask FileFMask FileGMask FileHMask )
View Source
const ( Rank1Mask uint64 = 0xFF << (8 * iota) Rank2Mask Rank3Mask Rank4Mask Rank5Mask Rank6Mask Rank7Mask Rank8Mask )
View Source
const ( FileA = iota FileB FileC FileD FileE FileF FileG FileH )
View Source
const ( Rank1 = iota Rank2 Rank3 Rank4 Rank5 Rank6 Rank7 Rank8 )
View Source
const ( SquareA1 = iota SquareB1 SquareC1 SquareD1 SquareE1 SquareF1 SquareG1 SquareH1 SquareA2 SquareB2 SquareC2 SquareD2 SquareE2 SquareF2 SquareG2 SquareH2 SquareA3 SquareB3 SquareC3 SquareD3 SquareE3 SquareF3 SquareG3 SquareH3 SquareA4 SquareB4 SquareC4 SquareD4 SquareE4 SquareF4 SquareG4 SquareH4 SquareA5 SquareB5 SquareC5 SquareD5 SquareE5 SquareF5 SquareG5 SquareH5 SquareA6 SquareB6 SquareC6 SquareD6 SquareE6 SquareF6 SquareG6 SquareH6 SquareA7 SquareB7 SquareC7 SquareD7 SquareE7 SquareF7 SquareG7 SquareH7 SquareA8 SquareB8 SquareC8 SquareD8 SquareE8 SquareF8 SquareG8 SquareH8 )
View Source
const ( SQUARE_NB = 64 RANK_NB = 8 FILE_NB = 8 COLOUR_NB = 2 PIECE_NB = 8 )
View Source
const ( SideWhite = 0 SideBlack = 1 )
View Source
const ( WhiteKingSide = 1 << iota WhiteQueenSide BlackKingSide BlackQueenSide )
View Source
const ( Empty int = iota Pawn Knight Bishop Rook Queen King )
View Source
const InitialPositionFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
View Source
const (
MaxMoves = 256
)
View Source
const MoveEmpty = Move(0)
View Source
const SquareNone = -1
Variables ¶
View Source
var ( SquareMask [64]uint64 KnightAttacks [64]uint64 KingAttacks [64]uint64 )
Functions ¶
func AllBlackPawnAttacks ¶
func AllWhitePawnAttacks ¶
func BishopAttacks ¶
func BitboardString ¶
func FileDistance ¶
func FlipSquare ¶
func IsDarkSquare ¶
func MakeSquare ¶
func MoreThanOne ¶
func ParseSquare ¶
func PawnAttacks ¶
func PawnAttacksNew ¶
func QueenAttacks ¶
func RankDistance ¶
func RookAttacks ¶
func SquareDistance ¶
func SquareName ¶
Types ¶
type LimitsType ¶
type Move ¶
type Move int32
func ParseMoveSAN ¶
func (Move) CapturedPiece ¶
func (Move) MovingPiece ¶
type OrderedMove ¶
type Position ¶
type Position struct {
Pawns, Knights, Bishops, Rooks, Queens, Kings, White, Black, Checkers uint64
WhiteMove bool
CastleRights, Rule50, EpSquare int
Key uint64
LastMove Move
}
func MirrorPosition ¶
func NewPositionFromFEN ¶
func (*Position) GenerateCaptures ¶
func (p *Position) GenerateCaptures(ml []OrderedMove) []OrderedMove
func (*Position) GenerateLegalMoves ¶
func (*Position) GenerateMoves ¶
func (p *Position) GenerateMoves(ml []OrderedMove) []OrderedMove
func (*Position) GetPieceTypeAndSide ¶
func (*Position) IsRepetition ¶
func (*Position) MakeNullMove ¶
func (*Position) PiecesByColor ¶
type SearchInfo ¶
type SearchParams ¶
type SearchParams struct { Positions []Position Limits LimitsType Progress func(si SearchInfo) }
Click to show internal directories.
Click to hide internal directories.