Example #1
0
 def view_init_location(self, boats=()):
     while not self:
         try:
             inputs = TTY.location_init(xyo=(boats is not ()))
             self.set_location(inputs[0], orientation=inputs[1], constraints=boats)
         except:
             self.__reset_location()
             TTY.location_error()
Example #2
0
    def __init__(self):
        self.__players = (Player(), Player())

        TTY.cls()
        TTY.player_show_turn('PLAYER 1')
        self.__players[0].view_set_name()
        self.__players[0].view_set_field()

        TTY.cls()
        TTY.player_show_turn('PLAYER 2')
        self.__players[1].view_set_name()
        self.__players[1].view_set_field()

        TTY.cls()
        while True:
            self.__players[0].attack(self.__players[1])
            self.__players[1].attack(self.__players[0])
Example #3
0
 def view_show_turn(self):
     TTY.player_show_turn(self.__name)
Example #4
0
 def view_set_name(self):
     self.setName(TTY.player_set_name())