Example #1
0
 print(m.get_lane_occupants(3, 3, "down", 5))
 print(m.get_lane_occupants(3, 3, "left", 5))
 print(m.get_lane_occupants(5, 3, "right", 5))
 print(m.place_ship(b, 7, 7, "up"))
 print(m.place_ship(b2, 5, 5, "left"))
 print(m.place_ship(p, 2, 2, "right"))
 for row in m.map:
     print(row)
 print(b.coords)
 print(type(b) == Ship)
 m.place_strike(6, 7)
 for row in m.map:
     print(row)
 print(b.coords)
 print(b.damage)
 print(b.get_hull_remaining())
 print(b.alive)
 print(m.ships)
 print(m.place_strike(7, 7))
 print(m.place_strike(5, 7))
 print(m.place_strike(4, 7))
 for row in m.map:
     print(row)
 print(b.coords)
 print(b.damage)
 print(b.get_hull_remaining())
 print(b.alive)
 print(m.ships)
 print(m.get_hit_coords())
 # for i in m.get_possible_ships(4, 4, 5):
 #     # print("\n")
Example #2
0
 print(m.get_lane_occupants(3, 3, "down", 5))
 print(m.get_lane_occupants(3, 3, "left", 5))
 print(m.get_lane_occupants(5, 3, "right", 5))
 print(m.place_ship(b, 7, 7, "up"))
 print(m.place_ship(b2, 5, 5, "left"))
 print(m.place_ship(p, 2, 2, "right"))
 for row in m.map:
     print(row)
 print(b.coords)
 print(type(b) == Ship)
 m.place_strike(6, 7)
 for row in m.map:
     print(row)
 print(b.coords)
 print(b.damage)
 print(b.get_hull_remaining())
 print(b.alive)
 print(m.ships)
 print(m.place_strike(7, 7))
 print(m.place_strike(5, 7))
 print(m.place_strike(4, 7))
 for row in m.map:
     print(row)
 print(b.coords)
 print(b.damage)
 print(b.get_hull_remaining())
 print(b.alive)
 print(m.ships)
 print(m.get_hit_coords())
 # for i in m.get_possible_ships(4, 4, 5):
 #     # print("\n")