コード例 #1
0
 def reset(self):
     for ship in Ship.SHORT_NAMES:
         s = Ship(0, 0, ship, False)
         self.update(s, [0] * s.get_size())
コード例 #2
0
    def add_ship(self, x, y, ship, vertical):
        '''Add a new ship, or change orientation of existing ship.'''

        s = Ship(x, y, ship, vertical)
        return self.add(s)