Skip to content

Commit

Permalink
Merge pull request #14 from healeycodes/bump-chess-1.5.0
Browse files Browse the repository at this point in the history
Bump chess package to 1.5.0
  • Loading branch information
healeycodes authored Jun 1, 2021
2 parents 3997c27 + 3316c9c commit 171ce2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# this module implement's Tomasz Michniewski's Simplified Evaluation Function
# https://www.chessprogramming.org/Simplified_Evaluation_Function
# note that the board layouts have been flipped and the top left square is A1

# fmt: off
piece_value = {
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
chess==1.4.0
chess==1.5.0
10 changes: 3 additions & 7 deletions test/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,24 @@ def test_end_game(self):
self.assertEqual(check_end_game(board), True)

def test_evaluate_board(self):
starting_fen = chess.Board(
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
)

white_down_one_pawn = chess.Board(
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPP1/RNBQKBNR w KQkq - 0 1"
)

self.assertTrue(
evaluate_board(starting_fen) > evaluate_board(white_down_one_pawn)
evaluate_board(chess.Board()) > evaluate_board(white_down_one_pawn)
)

white_played_e2e4 = chess.Board(
"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1"
)

self.assertTrue(
evaluate_board(starting_fen) < evaluate_board(white_played_e2e4)
evaluate_board(chess.Board()) < evaluate_board(white_played_e2e4)
)

black_played_b8c6 = chess.Board(
'r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2'
"r1bqkbnr/pppppppp/2n5/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2"
)

self.assertTrue(
Expand Down

0 comments on commit 171ce2f

Please sign in to comment.