def populateGrid(grid, chance):
    for i in range(len(grid)):
        for j in range(len(grid[0])):
            if (random.randint(0, 100) <= chance):
                grid[i][j] = 1
    return grid
def populateGrid(grid, chance):
    for i in range(len(grid)):
        for j in range(len(grid[0])):
            if (random.randint(0, 100) <= chance):
                grid[i][j] = 1
    return grid