# # This file contains output from three runs of a Project4 program. The first, # shows program output when the user enters input values for the maze size and # the wall coordinates, the second shows program output when it is run by # redirecting stdin from a file, the third shows program output when there # does not exist a path through the maze. # ################################################################# example 1 % java Project4 This program finds a path through an mxn maze You will first enter the size of the maze and the positions of the internal walls. The program will then find a path through the maze, and print the path to the screen. Enter number of rows in maze: 6 Enter number of columns in maze: 6 Enter the coordinates of the internal walls in the maze as a list of i j pairs. Enter one pair per line, and use -1 to signal the end of the series (i must be between 0 and 5, and j must be between 0 and 5): 1 0 1 2 2 2 3 1 3 2 4 2 1 4 2 4 3 3 2 5 -1 Maze: ---- 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 Path found using a stack for search: ----------------------------------- [0, 0] [0, 1] [1, 1] [2, 1] [2, 0] [3, 0] [4, 0] [4, 1] [5, 1] [5, 2] [5, 3] [5, 4] [5, 5] path length = 13 Maze with Path: -------------- X X 0 0 0 0 1 X 1 0 1 0 X X 1 0 1 1 X 1 1 1 0 0 X X 1 0 0 0 0 X X X X X Path found using a queue for search: ----------------------------------- [0, 0] [0, 1] [1, 1] [2, 1] [2, 0] [3, 0] [4, 0] [5, 0] [5, 1] [5, 2] [5, 3] [5, 4] [5, 5] path length = 13 Maze with Path: -------------- X X 0 0 0 0 1 X 1 0 1 0 X X 1 0 1 1 X 1 1 1 0 0 X 0 1 0 0 0 X X X X X X ################################################################# example 2 % cat test_input 10 12 5 5 4 5 3 4 2 2 1 1 1 3 1 5 6 9 8 11 7 11 4 8 4 9 4 10 4 11 -1 % java Project4 < test_input This program finds a path through an mxn maze You will first enter the size of the maze and the positions of the internal walls. The program will then find a path through the maze, and print the path to the screen. Enter number of rows in maze: Enter number of columns in maze: Enter the coordinates of the internal walls in the maze as a list of i j pairs. Enter one pair per line, and use -1 to signal the end of the series (i must be between 0 and 9, and j must be between 0 and 11): Maze: ---- 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 Path found using a stack for search: ----------------------------------- [0, 0] [0, 1] [0, 2] [0, 3] [0, 4] [0, 5] [0, 6] [0, 7] [0, 8] [0, 9] [0, 10] [0, 11] [1, 11] [2, 11] [3, 11] [3, 10] [3, 9] [3, 8] [3, 7] [4, 7] [5, 7] [5, 8] [5, 9] [5, 10] [6, 10] [7, 10] [8, 10] [9, 10] [9, 11] path length = 29 Maze with Path: -------------- X X X X X X X X X X X X 0 1 0 1 0 1 0 0 0 0 0 X 0 0 1 0 0 0 0 0 0 0 0 X 0 0 0 0 1 0 0 X X X X X 0 0 0 0 0 1 0 X 1 1 1 1 0 0 0 0 0 1 0 X X X X 0 0 0 0 0 0 0 0 0 0 1 X 0 0 0 0 0 0 0 0 0 0 0 X 1 0 0 0 0 0 0 0 0 0 0 X 1 0 0 0 0 0 0 0 0 0 0 X X Path found using a queue for search: ----------------------------------- [0, 0] [1, 0] [2, 0] [3, 0] [4, 0] [5, 0] [6, 0] [7, 0] [8, 0] [9, 0] [9, 1] [9, 2] [9, 3] [9, 4] [9, 5] [9, 6] [9, 7] [9, 8] [9, 9] [9, 10] [9, 11] path length = 21 Maze with Path: -------------- X 0 0 0 0 0 0 0 0 0 0 0 X 1 0 1 0 1 0 0 0 0 0 0 X 0 1 0 0 0 0 0 0 0 0 0 X 0 0 0 1 0 0 0 0 0 0 0 X 0 0 0 0 1 0 0 1 1 1 1 X 0 0 0 0 1 0 0 0 0 0 0 X 0 0 0 0 0 0 0 0 1 0 0 X 0 0 0 0 0 0 0 0 0 0 1 X 0 0 0 0 0 0 0 0 0 0 1 X X X X X X X X X X X X ################################################################# example 3 % java Project4 < test_input3 This program finds a path through an mxn maze You will first enter the size of the maze and the positions of the internal walls. The program will then find a path through the maze, and print the path to the screen. Enter number of rows in maze: Enter number of columns in maze: Enter the coordinates of the internal walls in the maze as a list of i j pairs. Enter one pair per line, and use -1 to signal the end of the series (i must be between 0 and 5, and j must be between 0 and 5): Maze: ---- 0 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 Path found using a stack for search: ----------------------------------- There is no path through this maze path length = 0 Path found using a queue for search: ----------------------------------- There is no path through this maze path length = 0 %