Skip to content

Commit 04bfe58

Browse files
author
Will DePue
committed
future planning
1 parent 92ff0c6 commit 04bfe58

File tree

5 files changed

+259
-13
lines changed

5 files changed

+259
-13
lines changed

evaluation.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func sort_moves_v1(moves []*chess.Move, board *chess.Board) []*chess.Move {
115115
if !DO_MOVE_SORTING {
116116
return moves
117117
}
118-
return quicksort(moves, board, evaluate_move_v1)
118+
return quicksort(moves, board, evaluate_move_v2)
119119
}
120120

121121
/*
@@ -232,9 +232,9 @@ func quiescence_moves_v1(moves []*chess.Move, board *chess.Board) []*chess.Move
232232
return q_moves
233233
}
234234
if DO_Q_MOVE_PRUNING {
235-
return quicksort_prune(q_moves, board, evaluate_q_move_v1)
235+
return quicksort_prune(q_moves, board, evaluate_q_move_v2)
236236
}
237-
return quicksort(q_moves, board, evaluate_q_move_v1)
237+
return quicksort(q_moves, board, evaluate_q_move_v2)
238238
}
239239

240240
/*

globals.go

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const CHESS_START_POSITION = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq
1414
var newGame = chess.NewGame()
1515
var explored int = 0
1616
var q_explored int = 0
17+
// make list of ints, initalized to 0
18+
var depth_count []int = make([]int, 100)
19+
1720
const ENGINE_MINIMAX_PLAIN_PLY int = 4
1821
const ENGINE_MINIMAX_PARALLEL_PLAIN_PLY int = 4
1922
const DO_MOVE_SORTING bool = true
@@ -36,6 +39,10 @@ var plain_engines = []Engine{
3639
}
3740

3841
func reset_counters() {
42+
// initialize depth_count to all 0s
43+
for i := range depth_count {
44+
depth_count[i] = 0
45+
}
3946
explored = 0
4047
q_explored = 0
4148
}

interesting_logs/weird_opening.log

+238
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
Initializing engine...
2+
Version go1.19.3
3+
NumCPU 6
4+
GOMAXPROCS 6
5+
6+
Running engine...
7+
Manual challenge started.
8+
Engine: Minimax Iterative Deepening Alpha Beta + Quiescence + Eval v3
9+
Playing as b
10+
Game:
11+
*
12+
13+
A B C D E F G H
14+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
15+
7♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
16+
6- - - - - - - -
17+
5- - - - - - - -
18+
4- - - - - - - -
19+
3- - - - - - - -
20+
2♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
21+
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
22+
23+
24+
Enter move:
25+
e4
26+
b e2e4 0
27+
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
28+
29+
A B C D E F G H
30+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
31+
7♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
32+
6- - - - - - - -
33+
5- - - - - - - -
34+
4- - - - ♙ - - -
35+
3- - - - - - - -
36+
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
37+
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
38+
39+
40+
w c7c5 0
41+
rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2
42+
43+
A B C D E F G H
44+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
45+
7♟ ♟ - ♟ ♟ ♟ ♟ ♟
46+
6- - - - - - - -
47+
5- - ♟ - - - - -
48+
4- - - - ♙ - - -
49+
3- - - - - - - -
50+
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
51+
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
52+
53+
54+
Enter move:
55+
Ng3
56+
Invalid move.
57+
Did you mean? [Ke2 Qe2 Qf3 Qg4 Qh5 Be2 Bd3 Bc4 Bb5 Ba6 Na3 Nc3 Ne2 Nf3 Nh3 a3 a4 b3 b4 c3 c4 d3 d4 f3 f4 g3 g4 h3 h4 e5]
58+
Enter move:
59+
Nf3
60+
b g1f3 0
61+
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
62+
63+
A B C D E F G H
64+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
65+
7♟ ♟ - ♟ ♟ ♟ ♟ ♟
66+
6- - - - - - - -
67+
5- - ♟ - - - - -
68+
4- - - - ♙ - - -
69+
3- - - - - ♘ - -
70+
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
71+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
72+
73+
74+
w g7g6 0
75+
rnbqkbnr/pp1ppp1p/6p1/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 0 3
76+
77+
A B C D E F G H
78+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
79+
7♟ ♟ - ♟ ♟ ♟ - ♟
80+
6- - - - - - ♟ -
81+
5- - ♟ - - - - -
82+
4- - - - ♙ - - -
83+
3- - - - - ♘ - -
84+
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
85+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
86+
87+
88+
Enter move:
89+
d4
90+
b d2d4 0
91+
rnbqkbnr/pp1ppp1p/6p1/2p5/3PP3/5N2/PPP2PPP/RNBQKB1R b KQkq d3 0 3
92+
93+
A B C D E F G H
94+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
95+
7♟ ♟ - ♟ ♟ ♟ - ♟
96+
6- - - - - - ♟ -
97+
5- - ♟ - - - - -
98+
4- - - ♙ ♙ - - -
99+
3- - - - - ♘ - -
100+
2♙ ♙ ♙ - - ♙ ♙ ♙
101+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
102+
103+
104+
w c5d4 0
105+
rnbqkbnr/pp1ppp1p/6p1/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq - 0 4
106+
107+
A B C D E F G H
108+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
109+
7♟ ♟ - ♟ ♟ ♟ - ♟
110+
6- - - - - - ♟ -
111+
5- - - - - - - -
112+
4- - - ♟ ♙ - - -
113+
3- - - - - ♘ - -
114+
2♙ ♙ ♙ - - ♙ ♙ ♙
115+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
116+
117+
118+
Enter move:
119+
Nd4
120+
Invalid move.
121+
Did you mean? [Kd2 Ke2 Qd2 Qe2 Qd3 Qxd4 Rg1 Bd2 Be3 Bf4 Bg5 Bh6 Be2 Bd3 Bc4 Bb5 Ba6 Nbd2 Na3 Nc3 Ng1 Nfd2 Nxd4 Nh4 Ne5 Ng5
122+
a3 a4 b3 b4 c3 c4 g3 g4 h3 h4 e5]
123+
Enter move:
124+
Nxd4
125+
b f3d4 0
126+
rnbqkbnr/pp1ppp1p/6p1/8/3NP3/8/PPP2PPP/RNBQKB1R b KQkq - 0 4
127+
128+
A B C D E F G H
129+
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
130+
7♟ ♟ - ♟ ♟ ♟ - ♟
131+
6- - - - - - ♟ -
132+
5- - - - - - - -
133+
4- - - ♘ ♙ - - -
134+
3- - - - - - - -
135+
2♙ ♙ ♙ - - ♙ ♙ ♙
136+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
137+
138+
139+
w g8f6 0
140+
rnbqkb1r/pp1ppp1p/5np1/8/3NP3/8/PPP2PPP/RNBQKB1R w KQkq - 1 5
141+
142+
A B C D E F G H
143+
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
144+
7♟ ♟ - ♟ ♟ ♟ - ♟
145+
6- - - - - ♞ ♟ -
146+
5- - - - - - - -
147+
4- - - ♘ ♙ - - -
148+
3- - - - - - - -
149+
2♙ ♙ ♙ - - ♙ ♙ ♙
150+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
151+
152+
153+
Enter move:
154+
e5
155+
b e4e5 0
156+
rnbqkb1r/pp1ppp1p/5np1/4P3/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 5
157+
158+
A B C D E F G H
159+
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
160+
7♟ ♟ - ♟ ♟ ♟ - ♟
161+
6- - - - - ♞ ♟ -
162+
5- - - - ♙ - - -
163+
4- - - ♘ - - - -
164+
3- - - - - - - -
165+
2♙ ♙ ♙ - - ♙ ♙ ♙
166+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
167+
168+
169+
w d7d6 0
170+
rnbqkb1r/pp2pp1p/3p1np1/4P3/3N4/8/PPP2PPP/RNBQKB1R w KQkq - 0 6
171+
172+
A B C D E F G H
173+
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
174+
7♟ ♟ - - ♟ ♟ - ♟
175+
6- - - ♟ - ♞ ♟ -
176+
5- - - - ♙ - - -
177+
4- - - ♘ - - - -
178+
3- - - - - - - -
179+
2♙ ♙ ♙ - - ♙ ♙ ♙
180+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
181+
182+
183+
Enter move:
184+
xf6
185+
Invalid move.
186+
Did you mean? [Kd2 Ke2 Qd2 Qe2 Qd3 Qf3 Qg4 Qh5 Rg1 Bd2 Be3 Bf4 Bg5 Bh6 Be2 Bd3 Bc4 Bb5+ Ba6 Nd2 Na3 Nc3 Ne2 Nb3 Nf3 Nb5 Nf5 Nc6 Ne6 a3 a4 b3 b4 c3 c4 f3 f4 g3 g4 h3 h4 exd6 e6 exf6]
187+
Enter move:
188+
exf6
189+
b e5f6 0
190+
rnbqkb1r/pp2pp1p/3p1Pp1/8/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 6
191+
192+
A B C D E F G H
193+
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
194+
7♟ ♟ - - ♟ ♟ - ♟
195+
6- - - ♟ - ♙ ♟ -
196+
5- - - - - - - -
197+
4- - - ♘ - - - -
198+
3- - - - - - - -
199+
2♙ ♙ ♙ - - ♙ ♙ ♙
200+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
201+
202+
203+
w f8g7 0
204+
rnbqk2r/pp2ppbp/3p1Pp1/8/3N4/8/PPP2PPP/RNBQKB1R w KQkq - 1 7
205+
206+
A B C D E F G H
207+
8♜ ♞ ♝ ♛ ♚ - - ♜
208+
7♟ ♟ - - ♟ ♟ ♝ ♟
209+
6- - - ♟ - ♙ ♟ -
210+
5- - - - - - - -
211+
4- - - ♘ - - - -
212+
3- - - - - - - -
213+
2♙ ♙ ♙ - - ♙ ♙ ♙
214+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
215+
216+
217+
Enter move:
218+
xg7
219+
Invalid move.
220+
Did you mean? [Kd2 Ke2 Qd2 Qe2 Qd3 Qf3 Qg4 Qh5 Rg1 Bd2 Be3 Bf4 Bg5 Bh6 Be2 Bd3 Bc4 Bb5+ Ba6 Nd2 Na3 Nc3 Ne2 Nb3 Nf3 Nb5 Nf5 Nc6 Ne6 a3 a4 b3 b4 c3 c4 f3 f4 g3 g4 h3 h4 fxe7 fxg7]
221+
Enter move:
222+
fxg7
223+
b f6g7 0
224+
rnbqk2r/pp2ppPp/3p2p1/8/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 7
225+
226+
A B C D E F G H
227+
8♜ ♞ ♝ ♛ ♚ - - ♜
228+
7♟ ♟ - - ♟ ♟ ♙ ♟
229+
6- - - ♟ - - ♟ -
230+
5- - - - - - - -
231+
4- - - ♘ - - - -
232+
3- - - - - - - -
233+
2♙ ♙ ♙ - - ♙ ♙ ♙
234+
1♖ ♘ ♗ ♕ ♔ ♗ - ♖
235+
236+
237+
Exiting engine.
238+
panic: chess: invalid move e8g8

main.exe

3.42 MB
Binary file not shown.

main.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ import (
88
"time"
99

1010
"github.com/notnil/chess"
11-
// "github.com/notnil/chess"
1211
)
1312

1413
/*
1514
1615
// Replace position with board.
1716
// Evaluation function.
18-
UCI compatibility. Ugh, this sucks. I might give up on this and do a web server.
1917
// Add in auto-testing using EPD files.
20-
Test different sorting algorithms.
21-
Why isn't the parallel version faster for perft?
18+
// Test different sorting algorithms.
2219
// Change checkmate value to not be max int.
2320
// Engine now prioritize the shortest checkmate.
2421
// Add in Eigenmann rapid engine test.
25-
2622
// Piece square tables.
23+
// Turn iterative deepening into an engine.
24+
// Change engine struct to be smarter.
25+
// Make iterative deepening play in time.
26+
27+
Why isn't the parallel version faster for perft?
2728
Better move ordering.
28-
Pick and sort
29+
Pick and sort, changes engine structure.
2930
// Hash MVV/LVA
3031
SEE
31-
// Turn iterative deepening into an engine.
32-
// Change engine struct to be smarter.
33-
Make iterative deepening play in time.
32+
UCI compatibility. Ugh, this sucks. I might give up on this and do a web server.
33+
Killer moves.
34+
Transposition tables.
3435
3536
*/
3637

@@ -88,7 +89,7 @@ func mini_challenge_manual_opening_custom() {
8889
func mini_challenge_manual_opening() {
8990
game := game_from_fen(CHESS_START_POSITION)
9091
subengine := engine_minimax_id_ab_q
91-
subengine.Set_Time(15)
92+
subengine.Set_Time(2)
9293
engine := NewOpeningWrapper(&subengine, game)
9394
challenge_manual(engine, chess.Black, game)
9495
}

0 commit comments

Comments
 (0)