Skip to content

Commit

Permalink
future planning
Browse files Browse the repository at this point in the history
  • Loading branch information
Will DePue committed Nov 14, 2022
1 parent 92ff0c6 commit 04bfe58
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 13 deletions.
6 changes: 3 additions & 3 deletions evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func sort_moves_v1(moves []*chess.Move, board *chess.Board) []*chess.Move {
if !DO_MOVE_SORTING {
return moves
}
return quicksort(moves, board, evaluate_move_v1)
return quicksort(moves, board, evaluate_move_v2)
}

/*
Expand Down Expand Up @@ -232,9 +232,9 @@ func quiescence_moves_v1(moves []*chess.Move, board *chess.Board) []*chess.Move
return q_moves
}
if DO_Q_MOVE_PRUNING {
return quicksort_prune(q_moves, board, evaluate_q_move_v1)
return quicksort_prune(q_moves, board, evaluate_q_move_v2)
}
return quicksort(q_moves, board, evaluate_q_move_v1)
return quicksort(q_moves, board, evaluate_q_move_v2)
}

/*
Expand Down
7 changes: 7 additions & 0 deletions globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const CHESS_START_POSITION = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq
var newGame = chess.NewGame()
var explored int = 0
var q_explored int = 0
// make list of ints, initalized to 0
var depth_count []int = make([]int, 100)

const ENGINE_MINIMAX_PLAIN_PLY int = 4
const ENGINE_MINIMAX_PARALLEL_PLAIN_PLY int = 4
const DO_MOVE_SORTING bool = true
Expand All @@ -36,6 +39,10 @@ var plain_engines = []Engine{
}

func reset_counters() {
// initialize depth_count to all 0s
for i := range depth_count {
depth_count[i] = 0
}
explored = 0
q_explored = 0
}
238 changes: 238 additions & 0 deletions interesting_logs/weird_opening.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
Initializing engine...
Version go1.19.3
NumCPU 6
GOMAXPROCS 6

Running engine...
Manual challenge started.
Engine: Minimax Iterative Deepening Alpha Beta + Quiescence + Eval v3
Playing as b
Game:
*

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
6- - - - - - - -
5- - - - - - - -
4- - - - - - - -
3- - - - - - - -
2♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖


Enter move:
e4
b e2e4 0
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
6- - - - - - - -
5- - - - - - - -
4- - - - ♙ - - -
3- - - - - - - -
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖


w c7c5 0
rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ ♟ ♟
6- - - - - - - -
5- - ♟ - - - - -
4- - - - ♙ - - -
3- - - - - - - -
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖


Enter move:
Ng3
Invalid move.
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]
Enter move:
Nf3
b g1f3 0
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ ♟ ♟
6- - - - - - - -
5- - ♟ - - - - -
4- - - - ♙ - - -
3- - - - - ♘ - -
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


w g7g6 0
rnbqkbnr/pp1ppp1p/6p1/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 0 3

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - - ♟ -
5- - ♟ - - - - -
4- - - - ♙ - - -
3- - - - - ♘ - -
2♙ ♙ ♙ ♙ - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Enter move:
d4
b d2d4 0
rnbqkbnr/pp1ppp1p/6p1/2p5/3PP3/5N2/PPP2PPP/RNBQKB1R b KQkq d3 0 3

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - - ♟ -
5- - ♟ - - - - -
4- - - ♙ ♙ - - -
3- - - - - ♘ - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


w c5d4 0
rnbqkbnr/pp1ppp1p/6p1/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq - 0 4

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - - ♟ -
5- - - - - - - -
4- - - ♟ ♙ - - -
3- - - - - ♘ - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Enter move:
Nd4
Invalid move.
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
a3 a4 b3 b4 c3 c4 g3 g4 h3 h4 e5]
Enter move:
Nxd4
b f3d4 0
rnbqkbnr/pp1ppp1p/6p1/8/3NP3/8/PPP2PPP/RNBQKB1R b KQkq - 0 4

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - - ♟ -
5- - - - - - - -
4- - - ♘ ♙ - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


w g8f6 0
rnbqkb1r/pp1ppp1p/5np1/8/3NP3/8/PPP2PPP/RNBQKB1R w KQkq - 1 5

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - ♞ ♟ -
5- - - - - - - -
4- - - ♘ ♙ - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Enter move:
e5
b e4e5 0
rnbqkb1r/pp1ppp1p/5np1/4P3/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 5

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
7♟ ♟ - ♟ ♟ ♟ - ♟
6- - - - - ♞ ♟ -
5- - - - ♙ - - -
4- - - ♘ - - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


w d7d6 0
rnbqkb1r/pp2pp1p/3p1np1/4P3/3N4/8/PPP2PPP/RNBQKB1R w KQkq - 0 6

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
7♟ ♟ - - ♟ ♟ - ♟
6- - - ♟ - ♞ ♟ -
5- - - - ♙ - - -
4- - - ♘ - - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Enter move:
xf6
Invalid move.
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]
Enter move:
exf6
b e5f6 0
rnbqkb1r/pp2pp1p/3p1Pp1/8/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 6

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ ♝ - ♜
7♟ ♟ - - ♟ ♟ - ♟
6- - - ♟ - ♙ ♟ -
5- - - - - - - -
4- - - ♘ - - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


w f8g7 0
rnbqk2r/pp2ppbp/3p1Pp1/8/3N4/8/PPP2PPP/RNBQKB1R w KQkq - 1 7

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ - - ♜
7♟ ♟ - - ♟ ♟ ♝ ♟
6- - - ♟ - ♙ ♟ -
5- - - - - - - -
4- - - ♘ - - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Enter move:
xg7
Invalid move.
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]
Enter move:
fxg7
b f6g7 0
rnbqk2r/pp2ppPp/3p2p1/8/3N4/8/PPP2PPP/RNBQKB1R b KQkq - 0 7

A B C D E F G H
8♜ ♞ ♝ ♛ ♚ - - ♜
7♟ ♟ - - ♟ ♟ ♙ ♟
6- - - ♟ - - ♟ -
5- - - - - - - -
4- - - ♘ - - - -
3- - - - - - - -
2♙ ♙ ♙ - - ♙ ♙ ♙
1♖ ♘ ♗ ♕ ♔ ♗ - ♖


Exiting engine.
panic: chess: invalid move e8g8
Binary file added main.exe
Binary file not shown.
21 changes: 11 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,30 @@ import (
"time"

"github.com/notnil/chess"
// "github.com/notnil/chess"
)

/*
// Replace position with board.
// Evaluation function.
UCI compatibility. Ugh, this sucks. I might give up on this and do a web server.
// Add in auto-testing using EPD files.
Test different sorting algorithms.
Why isn't the parallel version faster for perft?
// Test different sorting algorithms.
// Change checkmate value to not be max int.
// Engine now prioritize the shortest checkmate.
// Add in Eigenmann rapid engine test.
// Piece square tables.
// Turn iterative deepening into an engine.
// Change engine struct to be smarter.
// Make iterative deepening play in time.
Why isn't the parallel version faster for perft?
Better move ordering.
Pick and sort
Pick and sort, changes engine structure.
// Hash MVV/LVA
SEE
// Turn iterative deepening into an engine.
// Change engine struct to be smarter.
Make iterative deepening play in time.
UCI compatibility. Ugh, this sucks. I might give up on this and do a web server.
Killer moves.
Transposition tables.
*/

Expand Down Expand Up @@ -88,7 +89,7 @@ func mini_challenge_manual_opening_custom() {
func mini_challenge_manual_opening() {
game := game_from_fen(CHESS_START_POSITION)
subengine := engine_minimax_id_ab_q
subengine.Set_Time(15)
subengine.Set_Time(2)
engine := NewOpeningWrapper(&subengine, game)
challenge_manual(engine, chess.Black, game)
}
Expand Down

0 comments on commit 04bfe58

Please sign in to comment.