Skip to content

Commit 171ce2f

Browse files
authored
Merge pull request #14 from healeycodes/bump-chess-1.5.0
Bump chess package to 1.5.0
2 parents 3997c27 + 3316c9c commit 171ce2f

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

Diff for: evaluate.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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
78
piece_value = {

Diff for: requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
chess==1.4.0
1+
chess==1.5.0

Diff for: test/test_evaluation.py

+3-7
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)