/** * * @author Alicia Maxwell */ public class Maze { private int[][] maze; private int rows; private int columns; private int endRow; private int endColumn; private int startRow; private int startColumn; //the maze will be an array where 1 indicates an open space //and 0 indicates a wall where you cann't stand. /** * Makes a maze with one entrance and one end point. * @param m the array (1=open space, 0=wall where you can't stand). * @param startR row of starting position. * @param startC column of starting position. * @param endR row of ending position. * @param endC column of ending position. */ public Maze(int[][] m, int startR, int startC, int endR, int endC) { maze=m; rows = m.length; columns = m[0].length; endRow=endR; endColumn=endC; startRow=startR; startColumn=startC; } //the maze will be viewed with asteriks where walls are //as specified by the assignment public String toString() { String sMaze=""; for (int i=0; i=rows || r<0 || c>=columns || c<0) return false; else return true; } public int getRows() { return rows; } public int getColumns() { return columns; } public int getStartRow() { return startRow; } public int getEndRow() { return endRow; } public int getStartColumn() { return startColumn; } public int getEndColumn() { return endColumn; } public int getValue(int r, int c) { return maze[r][c]; } public int[][] getMaze() { return maze; } }