18 20_mazetraversal_hard - agarmstrong21/agarmstrong_swd_2019 GitHub Wiki

18-20_MazeTraversal_Hard

Portfolio Home Page

Problem Statement

image

User Documentation

Maze Traversal is a program when given a start point and a given 12x12 char array, can traverse through the whole thing, leave a 'bread crumb' trail, and then give the user all the steps there. The program checks down, right, up, left, in that order. Whenever there is a '.' instead of wall('#') then it will pick that path. After moving, it will leave '-' as its trail. The marker is a 'A' to show where it is. Then once it hits a dead end, it will return to the previous point of intersection and leave '0' in the dead end. Once it finds the end, it will end the program and present a path to the end of the maze.

Developer Documentation

Driver starts up the Test class. The Test class 'runs' tests but does not leave behind a 'pass/fail' output. These are only different mazes running all at the same time. Test has 4 pre-made mazes and tests to run, with a 5th test that can be entered by other users. There are diagrams of how the mazes look under the methods they are under (maze1-5). Once the test starts, the Class Traversal will take in the Maze and the starting point and recursively go through the options of down, right, up, and left, until an end is found. Like noted above, the marker is a 'A', 'bread crumb trail' is '-', dead ends are '0', walls are '#', and '.' are possible moves. When a dead end is found (no options to move up, down, left, right) it recursively moves back and leaves '0' in its place. Once 'A' finds the end, or when 'A' is at a x or y cord that is 0 or 12, assuming the end, it will end the program and show the path it took to get there.

image

Java Docs

The java documents are served from a local web server on this machine. To start the web server, navigate to the directory immediately above where the source code is checked out (i.e. ~/git ) and then use "python -m SimpleHTTPServer" in that directory.

cd ~/git python -m SimpleHTTPServer&

Note: if you are running python 3 (which you can check via opening a terminal and typing: python --version), then the command is:

python3 -m http.server

Java Docs for 18-20_MazeTraversal_Hard

Source Code

Source Code for 18-20_MazeTraversal_Hard