server/game/board.py
def shot(self, num):
        '''
        Shot
        Returns False if it's imposible to shot
        Or board and change_turn=True in case of miss
        '''
        change_turn = False
        x = num % 10
        y = int(num/10)
        brd = self.board
        if brd[y][x] in (Cell.DEAD, Cell.MISS, Cell.HIT): return False
        if brd[y][x] == Cell.EMPTY:
            brd[y][x] = Cell.MISS
            change_turn = True
        else:
            brd[y][x] = Cell.HIT
            self.kill_check(self.board, x, y)
        # copy board but hide alive ships
        return ([[x.value if x != Cell.SHIP else 0 for x in y] for y in brd]), change_turn

        Shot
        Returns False if it's imposible to shot
        Or board and change_turn=True in case of miss
        
Shot
Returns False if it's imposible to shot
Or board and change_turn=True in case of miss
Shot Returns False if it ' s imposible to shot Or board and change_turn = True in case of miss
def shot(self, num):
        change_turn = False
        x = num % 10
        y = int(num/10)
        brd = self.board
        if brd[y][x] in (Cell.DEAD, Cell.MISS, Cell.HIT): return False
        if brd[y][x] == Cell.EMPTY:
            brd[y][x] = Cell.MISS
            change_turn = True
        else:
            brd[y][x] = Cell.HIT
            self.kill_check(self.board, x, y)
        return ([[x.value if x != Cell.SHIP else 0 for x in y] for y in brd]), change_turn
def shot ( self , num ) : change_turn = False x = num % 10 y = int ( num / 10 ) brd = self . board if brd [ y ] [ x ] in ( Cell . DEAD , Cell . MISS , Cell . HIT ) : return False if brd [ y ] [ x ] == Cell . EMPTY : brd [ y ] [ x ] = Cell . MISS change_turn = True else : brd [ y ] [ x ] = Cell . HIT self . kill_check ( self . board , x , y ) return ( [ [ x . value if x != Cell . SHIP else 0 for x in y ] for y in brd ] ) , change_turn
Shot
Returns False if it's imposible to shot
Or board and change_turn=True in case of miss
Shot Returns False if it ' s imposible to shot Or board and change_turn = True in case of miss
'''
        Shot
        Returns False if it's imposible to shot
        Or board and change_turn=True in case of miss
        ''' # copy board but hide alive ships
self
num