Maze Runner

Introduction


Welcome Adventurer. Your aim is to navigate the maze and reach the finish point without touching any walls. Doing so will kill you instantly!

Task


You will be given a 2D array of the maze and an array of directions. Your task is to follow the directions given. If you reach the end point before all your moves have gone, you should return Finish. If you hit any walls or go outside the maze border, you should return Dead. If you find yourself still in the maze after using all the moves, you should return Lost.

The Maze array will look like

maze = [[1,1,1,1,1,1,1],
        [1,0,0,0,0,0,3],
        [1,0,1,0,1,0,1],
        [0,0,1,0,0,0,1],
        [1,0,1,0,1,0,1],
        [1,0,0,0,0,0,1],
        [1,2,1,0,1,0,1]]

..with the following key

Rules

Good luck, and stay safe!

Kata Series

If you enjoyed this, then please try one of my other Katas. Any feedback, translations and grading of beta Katas are greatly appreciated. Thank you.

Maze Runnerarrow-up-right

Scooby Doo Puzzlearrow-up-right

Driving Licensearrow-up-right

Connect 4arrow-up-right

Vending Machinearrow-up-right

Snakes and Laddersarrow-up-right

Mastermindarrow-up-right

Guess Who?arrow-up-right

Am I safe to drive?arrow-up-right

Mexican Wavearrow-up-right

Pigs in a Penarrow-up-right

Hungry Hipposarrow-up-right

Plenty of Fish in the Pondarrow-up-right

Fruit Machinearrow-up-right

Car Park Escapearrow-up-right

Solutions

🐍 Python

Last updated

Was this helpful?