Maze file boya.ice:
89 ########## S0 ## 0 #### 0 ## 00 #### 0 ## 0 #### 0000 ##### 0 ## 0 #### # 0 ## 00e ### 0000 ####
Package maze; import java.io. *; import java.util. *; public class maze {private char [] maze; // labyrinth array private int startX, starty, endx, endy; // labyrinth starting point, end point Location Private INT X, Y, STEP = 0; // Maze Create Object Private Maze (String FileName) {Try {LinkedList Alist = New LINKEDLIST (); // Used to store files The contents of each row bufferedreader files = new buffereader ("map //" filename)); // Add the contents of each row in line Temp = new string (); int i = 0; while (Temp = files.readline ())! = null) {alist.add (temp);} files.close (); // read and set the length width x = integer.parseint ((String) Alist.GetFirst ()) 2; alist.removefirst (); y = integer.parseint ((String) Alist.getfirst () 2; alist.removefirst (); // Initialize Maze = New Char in accordance with long and wide to the maze X] [y]; // Give the maze to the peripheral wall for (i = 0; i }}} // Recursive method looks for path private boolean Findway (INT X, INT Y) {if (Maze [ENDX] [Endy] == 'I') Return True; ELSE IF (Maze [x] [Y] == ' 0 ') {maze [x] [y] =' i '; if (Findway (X-1, Y)) Return True; Else IF (Findway (X 1, Y)) Return True; Else IF (Findway X, Y 1)) Return True; Else IF (Findway (X, Y-1)) Return True; Else {MAZE [X] [Y] = 'c'; Return False;}} else returnaf false;} / / Print Maze Path Private Void Show () {Maze [StartX] [Starty] = 'S'; Maze [ENDX] [Endy] = 'E'; for (INT I = 1; I