Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String x;
- String y;
- Scanner fileName = null;
- try {
- fileName = new Scanner(new File("C:/Users/TOSHIBA/Desktop/maze21.txt"));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- List<String> tempList = new ArrayList<>();
- while (fileName.hasNextLine()) {
- String line = fileName.nextLine();
- tempList.add(line);
- }
- //x = fileName.nextLine();
- //y = fileName.nextLine();
- //int row = x.length();
- //int column = y.length();
- boolean[][] cells = new boolean[tempList.size()][tempList.get(0).length()];
- //String finalX = fileName.nextLine();
- //String finalY = fileName.nextLine();
- ///cells[finalX.length()][finalY.length()] = true;
- for (int i = 0; i < cells.length; i++) {
- for (int j = 0; j < cells[i].length; j++) {
- if (cells[i][j])
- System.out.print("#");
- else
- System.out.print(" ");
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement