Beispiel #1
0
def do(data, starting_panel):
    robot = Robot(data, starting_panel)
    while not robot.brain.on_fire:
        robot.step()
    boundaries = Visualizer.boundaries(robot.painted.keys())
    if starting_panel == 1:
        viz = Visualizer(boundaries, 10)
        point_size = 5
    else:
        viz = Visualizer(boundaries, 100)
        point_size = 50
    for p, color in robot.painted.items():
        if color:
            viz.draw_square(p, WHITE, point_size)
    viz.show()
    return len(robot.painted)