Courses‎ > ‎AP Computer Science 2‎ > ‎Konstantinovich‎ > ‎

2017-06-07

posted Jun 7, 2017, 7:22 PM by Samuel Konstantinovich
1. Make sure the only println statement in your mazeSolver is activated when animate is turned on.
OTHERWISE, there should be NO PRINT STATEMENTS.

//If you run this there should be NO OUTPUT AT ALL:
MazeSolver s = new MazeSolver()
s.solve(1)
String ans = s.toString();


2. Make sure your MazeSolver.java has:
 
public MazeSolver(String filename, boolean animate){
   /* You wrote this */
}

public void solve(int mode){
   /* You wrote this */
}

//The rest are all one liners so I included them:

public MazeSolver(String filename){
    this(filename,false);
}

public void solve(){
    solve(1);
}


 public String toString(){
   return maze.toString(); //maze instance variable is maze in this case
 }

 public String toString(int n){
    return maze.toString(n); //maze instance variable is maze in this case
 }

  
Comments