File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# this module implement's Tomasz Michniewski's Simplified Evaluation Function
4
4
# https://www.chessprogramming.org/Simplified_Evaluation_Function
5
+ # note that the board layouts have been flipped and the top left square is A1
5
6
6
7
# fmt: off
7
8
piece_value = {
Original file line number Diff line number Diff line change 1
- chess == 1.4 .0
1
+ chess == 1.5 .0
Original file line number Diff line number Diff line change @@ -113,28 +113,24 @@ def test_end_game(self):
113
113
self .assertEqual (check_end_game (board ), True )
114
114
115
115
def test_evaluate_board (self ):
116
- starting_fen = chess .Board (
117
- "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
118
- )
119
-
120
116
white_down_one_pawn = chess .Board (
121
117
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPP1/RNBQKBNR w KQkq - 0 1"
122
118
)
123
119
124
120
self .assertTrue (
125
- evaluate_board (starting_fen ) > evaluate_board (white_down_one_pawn )
121
+ evaluate_board (chess . Board () ) > evaluate_board (white_down_one_pawn )
126
122
)
127
123
128
124
white_played_e2e4 = chess .Board (
129
125
"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1"
130
126
)
131
127
132
128
self .assertTrue (
133
- evaluate_board (starting_fen ) < evaluate_board (white_played_e2e4 )
129
+ evaluate_board (chess . Board () ) < evaluate_board (white_played_e2e4 )
134
130
)
135
131
136
132
black_played_b8c6 = chess .Board (
137
- ' r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2'
133
+ " r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2"
138
134
)
139
135
140
136
self .assertTrue (
You can’t perform that action at this time.
0 commit comments