Exemplo n.º 1
0
def test_part_two(size=10):
    import runAnt as P
    P.pygame.init()
    window_size = [size * P.WIDTH + 20, size * P.HEIGHT + 20]
    screen = P.pygame.display.set_mode(window_size)
    P.pygame.display.set_caption("Langton's Ant")
    board = P.Board(size)
    moveCount = 0
    clock = P.pygame.time.Clock()
    P.draw_grid(screen,board.size)
    P.pygame.display.flip()
    time.sleep(2)
    P.pygame.quit()
Exemplo n.º 2
0
def test_part_two(size=10):
    import runAnt as P
    P.pygame.init()
    window_size = [size * P.WIDTH + 20, size * P.HEIGHT + 20]
    screen = P.pygame.display.set_mode(window_size)
    P.pygame.display.set_caption("Langton's Ant")
    board = P.Board(size)
    moveCount = 0
    clock = P.pygame.time.Clock()
    P.draw_grid(screen, board.size)
    P.pygame.display.flip()
    time.sleep(2)
    P.pygame.quit()
Exemplo n.º 3
0
def test_part_three(size=10):
    import runAnt as P
    P.pygame.init()
    window_size = [size * P.WIDTH + 20, size * P.HEIGHT + 20]
    screen = P.pygame.display.set_mode(window_size)
    P.pygame.display.set_caption("Langton's Ant")
    board = P.Board(size)
    moveCount = 0
    clock = P.pygame.time.Clock()
    for sprite in board.squares:
        g = P.pygame.sprite.Group(sprite)
        g.draw(screen)
        P.pygame.display.flip()
        time.sleep(.05)
    P.draw_grid(screen,board.size)
    P.pygame.display.flip()
    time.sleep(1.5)
    P.pygame.quit()
Exemplo n.º 4
0
def test_part_three(size=10):
    import runAnt as P
    P.pygame.init()
    window_size = [size * P.WIDTH + 20, size * P.HEIGHT + 20]
    screen = P.pygame.display.set_mode(window_size)
    P.pygame.display.set_caption("Langton's Ant")
    board = P.Board(size)
    moveCount = 0
    clock = P.pygame.time.Clock()
    for sprite in board.squares:
        g = P.pygame.sprite.Group(sprite)
        g.draw(screen)
        P.pygame.display.flip()
        time.sleep(.05)
    P.draw_grid(screen, board.size)
    P.pygame.display.flip()
    time.sleep(1.5)
    P.pygame.quit()