File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 22
33# this module implement's Tomasz Michniewski's Simplified Evaluation Function
44# https://www.chessprogramming.org/Simplified_Evaluation_Function
5+ # note that the board layouts have been flipped and the top left square is A1
56
67# fmt: off
78piece_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):
113113 self .assertEqual (check_end_game (board ), True )
114114
115115 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-
120116 white_down_one_pawn = chess .Board (
121117 "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPP1/RNBQKBNR w KQkq - 0 1"
122118 )
123119
124120 self .assertTrue (
125- evaluate_board (starting_fen ) > evaluate_board (white_down_one_pawn )
121+ evaluate_board (chess . Board () ) > evaluate_board (white_down_one_pawn )
126122 )
127123
128124 white_played_e2e4 = chess .Board (
129125 "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1"
130126 )
131127
132128 self .assertTrue (
133- evaluate_board (starting_fen ) < evaluate_board (white_played_e2e4 )
129+ evaluate_board (chess . Board () ) < evaluate_board (white_played_e2e4 )
134130 )
135131
136132 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"
138134 )
139135
140136 self .assertTrue (
You can’t perform that action at this time.
0 commit comments