-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlan_Moves.txt
108 lines (85 loc) · 2.68 KB
/
Plan_Moves.txt
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
class Bitboard{
...
};
class ChessBoard{
Chessboard(bitborad Pawns, ...)
Chessboard(Chessboard currentChessBoard, Move MoveApplied) //return kainouria Chessboard dedomenis mias kinisis, dld ton startIndex kai endIndex
//kai if an ginei capture
array[Moves] getMoves{
if (check) {
...
}
bb King_moves_legal();
//apople3e, orise moves kai append to resultArray
Bitboard [pins, pinners] = find_pins(); //see xRayAttacks
for pins {
//only move along the pin direction (easy since we have each pinner)
}
for !pins { //NOT(XOR(White, pins))
BitboardPawns -= pins;
temp[Bitboard] = BitboardPawns.Generate_left_captures(current);
for bb in temp: //apople3e, orise moves kai append to resultArray
resultArray.add( Move(Bitboard, ) ))
//etc
revert this: BitboardPawns -= pins;
...
}
return resultArray;
//WHAT IS "changes required p.x. occupied"?
}
};
class Move {
public:
Move(start,end,isCapture);
protected:
int startIndex;
int endIndex;
bool isCapture;
}
class Node{
...
Chessboard c;
moves = c.getMoves();
for Move in moves:
new Chessboard(c, Move);
node.addChild();
bool afterCapture; //
};
class BitboardPawns : Bitboard{
Bitboard current;
Bitboard Generate_left_captures(current){
return new Bitboard with pawn position after Left Captures
}
Bitboard Generate_right_captures(current){
return new Bitboard with pawn position after Right Captures
}
Bitboard Generate_front_moves(current){
return new Bitboard with pawn position after front moves
}
Bitboard Generate_double_front_moves(current){
return new Bitboard with pawn position after front moves
}
//ekkremei an passan
}
class Knights{
Bitboard current;
list[] extract_knights_index(current){
return list of indexes of knights
}
Bitboard Generate_moves_from_index(index){
return precalculated moves given an index
}
};
Same class for King ??
class Bishop{
Bitboard current
list[] extract_bishop_index(current){
return list of indexes of knights
}
Bitboard Get_Blockers(current ChessBoard position, index)
return Bitboard with 1 where blocker
moves Generate_moves_from_index(index){
return precalculated moves given an index
}
};
Same for Rook, Queen