constants

package
v0.0.0-...-6879a08 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitNormal          = "normal"
	BitCapture         = "capture"
	BitBigPawn         = "bigPawn"
	BitEpCapture       = "epCapture"
	BitPromotion       = "promotion"
	BitKingSideCastle  = "kingSideCastle"
	BitQueenSideCastle = "queenSideCastle"
)
View Source
const (
	Rank1 = 7
	Rank2 = 6
	Rank7 = 1
	Rank8 = 0
)
View Source
const (
	ColorWhite = "w"
	ColorBlack = "b"
)

Sides

View Source
const (
	PiecePawn   = "p"
	PieceKnight = "n"
	PieceBishop = "b"
	PieceRook   = "r"
	PieceQueen  = "q"
	PieceKing   = "k"
)

Pieces

View Source
const (
	TerminationWhiteVictory = "1-0"
	TerminationBlackVictory = "0-1"
	TerminationDraw         = "1/2-1/2"
	TerminationInProgress   = "*"
)

Terminations

View Source
const DefaultPositionFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
View Source
const EmptySquare = -1
View Source
const PieceSymbols = "pnbrqkPNBRQK"

Variables

View Source
var Attacks = []int{}/* 239 elements not displayed */
View Source
var Ox88 = map[string]int{
	"a8": 0, "b8": 1, "c8": 2, "d8": 3, "e8": 4, "f8": 5, "g8": 6, "h8": 7,
	"a7": 16, "b7": 17, "c7": 18, "d7": 19, "e7": 20, "f7": 21, "g7": 22, "h7": 23,
	"a6": 32, "b6": 33, "c6": 34, "d6": 35, "e6": 36, "f6": 37, "g6": 38, "h6": 39,
	"a5": 48, "b5": 49, "c5": 50, "d5": 51, "e5": 52, "f5": 53, "g5": 54, "h5": 55,
	"a4": 64, "b4": 65, "c4": 66, "d4": 67, "e4": 68, "f4": 69, "g4": 70, "h4": 71,
	"a3": 80, "b3": 81, "c3": 82, "d3": 83, "e3": 84, "f3": 85, "g3": 86, "h3": 87,
	"a2": 96, "b2": 97, "c2": 98, "d2": 99, "e2": 100, "f2": 101, "g2": 102, "h2": 103,
	"a1": 112, "b1": 113, "c1": 114, "d1": 115, "e1": 116, "f1": 117, "g1": 118, "h1": 119,
}
View Source
var PawnOffsets = map[string][4]int{
	ColorBlack: {16, 32, 17, 15},
	ColorWhite: {-16, -32, -17, -15},
}
View Source
var PieceMasks = map[string]int{
	"p": 0x1,
	"n": 0x2,
	"b": 0x4,
	"r": 0x8,
	"q": 0x10,
	"k": 0x20,
}
View Source
var PieceOffsets = map[string][]int{
	PieceKnight: {-18, -33, -31, -14, 18, 33, 31, 14},
	PieceBishop: {-17, -15, 17, 15},
	PieceRook:   {-16, 1, 16, -1},
	PieceQueen:  {-17, -16, -15, 1, 17, 16, 15, -1},
	PieceKing:   {-17, -16, -15, 1, 17, 16, 15, -1},
}
View Source
var Rays = []int{}/* 239 elements not displayed */
View Source
var Rooks = map[string][]map[string]int{
	ColorWhite: {
		{"square": Ox88["a1"], "flag": Bits[BitQueenSideCastle]},
		{"square": Ox88["h1"], "flag": Bits[BitKingSideCastle]},
	},
	ColorBlack: {
		{"square": Ox88["a8"], "flag": Bits[BitQueenSideCastle]},
		{"square": Ox88["h8"], "flag": Bits[BitKingSideCastle]},
	},
}
View Source
var SecondRank = map[string]int{
	ColorBlack: Rank7,
	ColorWhite: Rank2,
}
View Source
var Sides = map[string]int{
	PieceKing:  Bits[BitKingSideCastle],
	PieceQueen: Bits[BitQueenSideCastle],
}
View Source
var Squares = []string{
	"a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8",
	"a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7",
	"a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6",
	"a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5",
	"a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4",
	"a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3",
	"a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2",
	"a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1",
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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