Example #1
0
 def get_ship_start_coords(self, ship_: Ship, orientation_: Orientation):
     while True:
         str_cell = input(
             f'{self.name}, enter the starting position for your {ship_.name} ship ,which is {ship_.length} long, in the form row, column:'
         )
         try:
             move = Move.from_str(str_cell)
             return move.row, move.col
         except MoveError as err:
             print(err)
Example #2
0
 def get_move(self, board_: Board) -> Move:
     str_move = input(
         f'{self.name}, enter the location you want to fire at in the form row, column: '
     )
     return Move.from_str(str_move)