labyrinth_explorer.py
def game(method, filterActionsValue, width,height):
    '''
    Used to initialise a maze and find the path
    Also records the time required to find the path
    '''
    setup(width,height)
    running = True
    updateScreen(player, end_rect, walls)

    t0 = time()
    path = mazeFinder.findSolution(method,filterActionsValue,player, end_rect, walls)
    t1 = time()
    totalTime = t1-t0
    print ("Solver took ",totalTime, ' seconds')
    recordResutls(totalTime, width, height, method, filterActionsValue)

    pygame.display.set_caption("Press space to start the route")
    while running:
        clock.tick(5)
        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                running = False
                pygame.quit()
            if e.type == pygame.KEYDOWN and e.key == pygame.K_ESCAPE:
                running = False
                pygame.quit()

        key = pygame.key.get_pressed()
        if key[pygame.K_SPACE]:
            pygame.display.set_caption("Following route")
            playOut(path)
            running = False
            pygame.quit()
        
        updateScreen(player, end_rect, walls)

    Used to initialise a maze and find the path
    Also records the time required to find the path
    
Used to initialise a maze and find the path
Also records the time required to find the path
Used to initialise a maze and find the path Also records the time required to find the path
def game(method, filterActionsValue, width,height):
    setup(width,height)
    running = True
    updateScreen(player, end_rect, walls)
    t0 = time()
    path = mazeFinder.findSolution(method,filterActionsValue,player, end_rect, walls)
    t1 = time()
    totalTime = t1-t0
    print ("Solver took ",totalTime, ' seconds')
    recordResutls(totalTime, width, height, method, filterActionsValue)
    pygame.display.set_caption("Press space to start the route")
    while running:
        clock.tick(5)
        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                running = False
                pygame.quit()
            if e.type == pygame.KEYDOWN and e.key == pygame.K_ESCAPE:
                running = False
                pygame.quit()
        key = pygame.key.get_pressed()
        if key[pygame.K_SPACE]:
            pygame.display.set_caption("Following route")
            playOut(path)
            running = False
            pygame.quit()
        updateScreen(player, end_rect, walls)
def game ( method , filterActionsValue , width , height ) : setup ( width , height ) running = True updateScreen ( player , end_rect , walls ) t0 = time ( ) path = mazeFinder . findSolution ( method , filterActionsValue , player , end_rect , walls ) t1 = time ( ) totalTime = t1 - t0 print ( "Solver took " , totalTime , ' seconds' ) recordResutls ( totalTime , width , height , method , filterActionsValue ) pygame . display . set_caption ( "Press space to start the route" ) while running : clock . tick ( 5 ) for e in pygame . event . get ( ) : if e . type == pygame . QUIT : running = False pygame . quit ( ) if e . type == pygame . KEYDOWN and e . key == pygame . K_ESCAPE : running = False pygame . quit ( ) key = pygame . key . get_pressed ( ) if key [ pygame . K_SPACE ] : pygame . display . set_caption ( "Following route" ) playOut ( path ) running = False pygame . quit ( ) updateScreen ( player , end_rect , walls )
Used to initialise a maze and find the path
Also records the time required to find the path
Used to initialise a maze and find the path Also records the time required to find the path
'''
    Used to initialise a maze and find the path
    Also records the time required to find the path
    '''
method
filterActionsValue
width
height