public static Maze2D read ( File file ) throws IOException { ArrayList < String > array = new ArrayList < String > ( ) ; BufferedReader br = new BufferedReader ( new FileReader ( file ) ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { array . add ( line ) ; } br . close ( ) ; return new Maze2D ( ( String [ ] ) array . toArray ( ) ) ; }
Read a maze from a file in plain text .