Draft

Maze Path Finder

Description:

Find a path throug the maze. Start at point A and goto point B. There could be more than one possible path to point B. The goal is to find a way arround the walls. Point A and B can be anyware inside the maze.

Given will be a maze, made of a 2 dimentional array of chars.

Example maze:

[
  ['.','.','.','.','.','.'],
  ['.','#','#','#','#','.'],
  ['.','#','B','.','#','.'],
  ['.','.','.','.','#','.'],
  ['#','#','#','#','#','.'],
  ['A','.','.','.','.','.']
]

The starting point is marked with an upper case A, the destination will be marked with a upper case B. Walls will be marked with a hashtag #. Periots . will make passable spaces.

If you walk into a Wall (#) the test will fail.

Return the path as a string defining the way with the letters of the four cardinal points (lower case).

the directions are oriented in the way the maze is displayed inside the code.

n = North (negative y)
e = East  (negative x)
w = West  (positive x)
s = South (positive y)

(maze array first dimention will be y, second will be x)

Example path:

"eeeeennnnnwwwwwssseen"

If there is no available path return an empty string.

There will allways be exactly one starting point (A) and exactly one destination point (B).

The maze will allways be a rectangle. (No different line lengths.)

You cant go diagonal.

Mazes will be generated randomly!

Stats:

CreatedFeb 10, 2020
Warriors Trained18
Total Skips0
Total Code Submissions70
Total Times Completed5
JavaScript Completions5
Total Stars1
% of votes with a positive feedback rating17% of 3
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes2
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • derDere Avatar
Ad