Maze Navigation

Maximilianjava

Neues Mitglied
Implement Ariadne's thread by conducting a depth-first search

  • Create a class EscapeRoute, which implements the search for the exit.
  • EscapeRoute needs to implement the following constructor and methods:






public EscapeRoute()
public int getPathLength()
public void search(Cell startingCell)



The search method starts at a given cell and proceeds as follows:

  • Explore the maze in the direction of the upper cell
  • Explore the maze in the direction of the right cell
  • Explore the maze in the direction of the down cell
  • Explore the maze in the direction of the left cell
I.e. we are proceeding clockwise. Your search ends, when you found the exit. I.e. the cell with its id set to −1−1. Use recursion to implement your depth-first-search.

Do not forget to mark cells as visited while exploring the maze. Store the number of visited cells along your path. The method getPathLength() should return this value.

In which order are your cells visited?


Hier komme ich nicht mehr weiter hat jemand eventuelle Lösungensansätze ?
 

Neue Themen


Oben