mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-27 13:14:15 -08:00
'Refactored by Sourcery'
This commit is contained in:
@@ -40,8 +40,8 @@ def place_ship(sea: SeaType, size: int, code: int) -> None:
|
||||
point = add_vector(point, vector)
|
||||
points.append(point)
|
||||
|
||||
if not all([is_within_sea(point, sea) for point in points]) or any(
|
||||
[value_at(point, sea) for point in points]
|
||||
if not all(is_within_sea(point, sea) for point in points) or any(
|
||||
value_at(point, sea) for point in points
|
||||
):
|
||||
# ship out of bounds or crosses other ship, trying again
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user