title: How to solve a maze with a Queue?
body: <p>I'm very confused on how I would solve a maze using a queue. I've provided some javadocs and some psuedo code that my professor has given us. Help if possibble. I've looked on other topics but I could not understand there's hopefully someone can help me with my solve method. thanks</p>
  
  <pre><code>public class QueueMazeSolver implements MazeSolver {
  
  private MazeGUI gui;
  
  public static class Cell {
  
      private int r;
      private int c;
  
      public Cell(int row, int col){
  
          r = row;
          c = col;
  
      }
  
  }
  
  
  public QueueMazeSolver(){
  
      gui = new MazeGUI( this );
  
  }
  
  /**
   * This method is called when the start button is
   * clicked in the MazeGUI.  This method should solve the maze.
   * This method may call MazeGUI.drawMaze(...) whenever the
   * GUI display should be updated (after each step of the solution).
   * 
   * The maze is provided as the first parameter.  It is a 2D array containing
   * characters that represent the spaces in the maze.  The following 
   * characters will be found in the array:
   *    '#' - This represents a wall.
   *    ' ' - This represents an open space (corridor)
   *    
   * When calling MazeGUI.drawMaze(...) to update the display, the GUI
   * will recognize the '#' and ' ' characters as well as the following:
   *    '@' - Means the cell is a space that has been explored
   *    '%' - Means that the cell is part of the best path to the goal.
   * 
   * @param maze the maze (see above).
   * @param startR the row of the start cell.
   * @param startC the column of the start cell.
   * @param endR the row of the end (goal) cell.
   * @param endC the column of the end (goal) cell.
   */
  @Override
  public void solve(char[][] maze, int startR, int startC, int endR, int endC) {
  
      maze[startR][startC] = '@';
  
      ArrayQueue&lt;Cell&gt; agenda = new ArrayQueue&lt;Cell&gt;();
  
      Cell temp = new Cell(startR, startC);
  
      agenda.offer(temp);
  
              // while agenda is not empty and red not found
      while(!agenda.isEmpty() &amp;&amp; maze[endR][endC] != '@' ){
  
          Cell current = agenda.poll(); //remove front square from queue
  
          /*
          if front square is red
              found it
          else 
              mark amaze all unexplored neighbors of front
              square and add them to the square
          */
  
          if(current == new Cell(endR, endC) ){
              break;
          }
          else{
  
              =
              }
          }
  
          /** Notes
          maze[r][c] = '@' //marking cell seen
  
          up = r-1, c
          down = r+1, c
          left = r, c-1
          right = r, c+1
          */
  
  
      }
  
      if (!agenda.isEmpty())
              gui.setStatusText("Maze is solvable");
      else
          gui.setStatusText("Maze is unsolvable");
  
  
  
      gui.drawMaze(maze);
      try {Thread.sleep(150);}
      catch (InterruptedException e){
          System.err.println("Thread interrupted");
      }       
   }
  
  public static void main(String[] args){
  
      QueueMazeSolver solver = new QueueMazeSolver();
  
     }
  
       }
  </code></pre>