コード例 #1
0
def two_hits():
    g = battleship.load_grid_from_file('grid1.grd')
    g.shoot((1,1))
    g.shoot((1,2))
    g.shoot((2,2))
    b = battleship.BlindGrid(g)
    return b.__dict__
コード例 #2
0
def only_miss():
    g = battleship.load_grid_from_file('grid1.grd')
    g.shoot((1,1))
    b = battleship.BlindGrid(g)
    return b.__dict__
コード例 #3
0
def no_shot():
    g = battleship.load_grid_from_file('grid1.grd')
    b = battleship.BlindGrid(g)
    return b.__dict__
コード例 #4
0
def sink_ship():
    g = battleship.load_grid_from_file('grid1.grd')
    g.shoot((2,2))
    res = g.shoot((1,2))
    return (res, g.__dict__)
コード例 #5
0
def miss_ships():
    g = battleship.load_grid_from_file('grid1.grd')
    res = g.shoot((1,1))
    return (res, g.__dict__)
コード例 #6
0
def load_helper(filename):
    return battleship.load_grid_from_file(filename).__dict__