import java.util.List;

public class Solution {

  private Maze m;
  private List<Dir> path;

  public Solution() {
    this.m = new Maze();
    this.path = null;
  }

  public Solution(Maze maze, List<Dir> path) {
    this.m = maze;
    this.path = path;
  }

  public boolean isValidPath() {
    // TODO question 2a - 5 marks, replace the stub
    //a maze missing its start or stop position cannot be valid
    return true;
  }

  public void putPathInMaze() {
    // TODO question 2b - 3 marks, replace the empty code
  }

  public void findPath() {
    // TODO question 2c - 5 marks, replace the empty code
  }

  public static void print(List<Dir> list) {
    assert list != null : "cannot print an empty list";
    for (int i = 0; i < list.size(); i++) {
      System.out.print(list.get(i));
    }
  }

  public void showResult() {
    if (path == null) {
      System.out.println("No solution");
    } else {
      System.out.println("A path through the maze from '>' to 'X' is:");
      print(path);
      System.out.println();
      System.out.println();
      m.print();
    }
    System.out.println();
  }

  public void solve() {
    System.out.println("The maze to be traversed is:");
    m.print();
    System.out.println();

    findPath();
    if (isValidPath()) {
      putPathInMaze();
    }
    showResult();
  }

}

