-
Notifications
You must be signed in to change notification settings - Fork 14
/
types.go
85 lines (72 loc) · 1.39 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package common
import "time"
const (
SQUARE_NB = 64
RANK_NB = 8
FILE_NB = 8
COLOUR_NB = 2
PIECE_NB = 8
)
const (
SideWhite = 0
SideBlack = 1
)
const (
WhiteKingSide = 1 << iota
WhiteQueenSide
BlackKingSide
BlackQueenSide
)
type Position struct {
Pawns, Knights, Bishops, Rooks, Queens, Kings, White, Black, Checkers uint64
WhiteMove bool
CastleRights, Rule50, EpSquare int
Key uint64
LastMove Move
}
const InitialPositionFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
const (
Empty int = iota
Pawn
Knight
Bishop
Rook
Queen
King
)
const (
MaxMoves = 256
)
type OrderedMove struct {
Move Move
Key int32
}
type LimitsType struct {
Ponder bool
Infinite bool
WhiteTime int
BlackTime int
WhiteIncrement int
BlackIncrement int
MoveTime int
MovesToGo int
Depth int
Nodes int
Mate int
}
type SearchParams struct {
Positions []Position
Limits LimitsType
Progress func(si SearchInfo)
}
type SearchInfo struct {
Score UciScore
Depth int
Nodes int64
Time time.Duration
MainLine []Move
}
type UciScore struct {
Centipawns int
Mate int
}