mazecells startcell exitcell maze array row row col col cellposition cellposition figure sample maze adt object indices are within the valid range the two methods that set the starting and exit positions simply create and store cellposition objects while the creation of wall fills the indicated cell using one of the named constants defined earlier helper methods during the actual process of finding solution in the findpath(methodwe will need to perform several routine operations that access the underlying multiarray object to aide in this taskwe define several helper methodsas shown in lines - firstwe will need to drop or place tokens as we move through the maze the marktried(and markpath(methods can be used for this task note we do not need "pickup tokenmethod since the task of picking up path token is immediately followed by dropping tried token the exitfound(method is used to determine if the exit is found based on the contents of the exitcell object and the current position supplied as arguments finallythe validmove(helper method is used to determine if we can move to given cell move is valid if the destination cell is open and its indices are not outside the border of the maze note an assertion is not used here since we do not want to flag an error insteadthe backtracking solution will have to try other directions when encountering an invalid move finding the path tip the findpath(method implements the actual path finding algorithm described earlierwhich searches through the maze for path from the starting position to the helper methods helper methods are commonly used in implementing classes to aide in subdividing larger problems and for reducing code repetition by defining method that can be called from within the different methods but helper methods can also be used to make your code more readable even if they only contain single line this use of helper methods is illustrated by the helper methods defined as part of the maze class