Пример #1
0
    def test_starting_position(self):
        maze = Maze(10, 10)
        create(maze)

        for x in range(0, len(maze[0])):
            if maze[0][x].getElement() == ' ':
                assert maze[0][x].getElement() == ' '
Пример #2
0
    def test_start_visited(self):
        maze = Maze(10, 10)
        create(maze)

        for x in range(0, len(maze[0])):
            if maze[0][x].getVisited() == False:
                assert maze[0][x].getVisited() == False
Пример #3
0
    def test_end_visited(self):
        maze = Maze(10, 10)
        create(maze)
        lastrow = len(maze) - 1

        for x in range(0, len(maze[lastrow])):
            if maze[lastrow][x].getElement() == ' ':
                assert maze[lastrow][x].getVisited() == True
def mm_maze_create(size):
    w, h = size.split('x')
    w, h = int(w), int(h)

    if w < 5 or h < 5:
        w, h = 5, 5

    maze = Maze(w, h)
    create(maze)
    bank.push(maze)

    print(messages("maze_created"))
    menu()