// maze solver // make a maze out of a "picture" of a maze. // '*' is a wall, 'S' is start, 'F' is finish, ' ' is a walk space. // no newlines or other characters allowed. // the array must have at least h strings each of at least w characters. makeMaze(text:array[string], w:int, h:int):Maze interface Maze { // solve the maze using the given algorithm solve(x:SolverAlgorithm) // put the maze back into unsolved form reset() // draw an ascii picture of the maze // for a solved maze, there will be a trail marked through // the maze if a solution is possible // for an unsolved maze, or if no solution is possible, // just draws the maze asText():array[string] } interface SolverAlgorithm { solve(m:MazeHelper) } interface MazeHelper { mazeWidth():int mazeHeight():int mazeStart():array[int] m(x,y:int):MazeBlock } interface MazeBlock { isWall():bool isFloor():bool isFinish():bool isMarked():bool mark(set:bool) } simpleSolver():SolverAlgorithm //wallHugger():SolverAlgorithm