mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Clean Code: Apply flake8-simplify to Python
Also flake8-comprehensions which was added to the CI For flake8-simplify, there are a few false-positives, e.g. https://github.com/MartinThoma/flake8-simplify/issues/115
This commit is contained in:
@@ -237,11 +237,11 @@ class Board:
|
||||
if self.spaces[landing_x][landing_y] == COMPUTER_PIECE:
|
||||
for delta_x in (-2, 2):
|
||||
test_record = self.try_extend(landing_x, landing_y, delta_x, -2)
|
||||
if not (move_record is None):
|
||||
if (best_move is None) or (
|
||||
move_record.quality > best_move.quality
|
||||
):
|
||||
best_move = test_record
|
||||
if (move_record is not None) and (
|
||||
(best_move is None)
|
||||
or (move_record.quality > best_move.quality)
|
||||
):
|
||||
best_move = test_record
|
||||
else:
|
||||
assert self.spaces[landing_x][landing_y] == COMPUTER_KING
|
||||
for delta_x in (-2, 2):
|
||||
|
||||
Reference in New Issue
Block a user