Skip to content

Commit

Permalink
Solution ver:2
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksiukStepan committed Aug 7, 2024
1 parent cdaebc7 commit a937dad
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,41 +125,3 @@ def create_empty_field() -> dict[tuple[int, int], Cell]:
for i in range(10)
for j in range(10)
})


if __name__ == "__main__":
shipss = [
((2, 0), (2, 3)),
((4, 5), (4, 6)),
((3, 8), (3, 9)),
((6, 0), (8, 0)),
((6, 4), (6, 6)),
((6, 8), (6, 9)),
((9, 9), (9, 9)),
((9, 5), (9, 5)),
((9, 3), (9, 3)),
((9, 7), (9, 7))
]
battle = Battleship(shipss)
# battle.print_field()
# battle.add_ships_to_the_field()
# battle.print_field()
# battle.fire((0, 0))
# battle.fire((0, 1))
# battle.fire((0, 2))
# battle.fire((0, 3))
# battle.fire((0, 4))
# print(battle.field)
print(battle.fire((0, 4))) # == "Miss!"
print(battle.fire((1, 7))) # == "Miss!"
print(battle.fire((2, 0))) # == "Hit!"
print(battle.fire((2, 1))) # == "Hit!"
print(battle.fire((2, 2))) # == "Hit!"
print(battle.fire((2, 3))) # == "Sunk!"
print(battle.fire((4, 3))) # == "Miss!"
print(battle.fire((4, 5))) # == "Hit!"
print(battle.fire((5, 5))) # == "Miss!"
print(battle.fire((4, 6))) # == "Sunk!"
print(battle.fire((9, 5))) # == "Sunk!"
print(battle.fire((9, 6))) #
pass

0 comments on commit a937dad

Please sign in to comment.