text: void PrintVector(vector<int> v) {
    cout << "{ ";
    for (auto item : v) {
      cout << item << " ";
    }
    cout << "}" << "\n";
  }
  
  void PrintVectorOfVectors(vector<vector<int>> v) {
    for (auto row : v) {
      cout << "{ ";
      for (auto col : row) {
        cout << col << " ";
      }
      cout << "}" << "\n";
    }
  }
  
  void PrintVectorOfVectors(vector<vector<State>> v) {
    for (auto row : v) {
      cout << "{ ";
      for (auto col : row) {
        cout << CellString(col) << " ";
      }
      cout << "}" << "\n";
    }
  }
  
  void TestHeuristic() {
    cout << "----------------------------------------------------------" << "\n";
    cout << "Heuristic Function Test: ";
    if (Heuristic(1, 2, 3, 4) != 4) {
      cout << "failed" << "\n";
      cout << "\n" << "Heuristic(1, 2, 3, 4) = " << Heuristic(1, 2, 3, 4) << "\n";
      cout << "Correct result: 4" << "\n";
      cout << "\n";
    } else if (Heuristic(2, -1, 4, -7) != 8) {
      cout << "TestHeuristic Failed" << "\n";
      cout << "\n" << "Heuristic(2, -1, 4, -7) = " << Heuristic(2, -1, 4, -7) << "\n";
      cout << "Correct result: 8" << "\n";
      cout << "\n";
    } else {
      cout << "passed" << "\n";
    }
    return;
  }
  
  void TestAddToOpen() {
    cout << "----------------------------------------------------------" << "\n";
    cout << "AddToOpen Function Test: ";
    int x = 3;
    int y = 0;
    int g = 5;
    int h = 7;
    vector<vector<int>> open{{0, 0, 2, 9}, {1, 0, 2, 2}, {2, 0, 2, 4}};
    vector<vector<int>> solution_open = open;
    solution_open.push_back(vector<int>{3, 0, 5, 7});
    vector<vector<State>> grid{{State::kClosed, State::kObstacle, State::kEmpty, State::kEmpty, State::kEmpty, State::kEmpty},
                              {State::kClosed, State::kObstacle, State::kEmpty, State::kEmpty, State::kEmpty, State::kEmpty},
                              {State::kClosed, State::kObstacle, State::kEmpty, State::kEmpty, State::kEmpty, State::kEmpty},
                              {State::kEmpty, State::kObstacle, State::kEmpty, State::kEmpty, State::kEmpty, State::kEmpty},
                              {State::kEmpty, State::kEmpty, State::kEmpty, State::kEmpty, State::kObstacle, State::kEmpty}};
    vector<vector<State>> solution_grid = grid;
    solution_grid[3][0] = State::kClosed;
    AddToOpen(x, y, g, h, open, grid);
    if (open != solution_open) {
      cout << "failed" << "\n";
      cout << "\n";
      cout << "Your open list is: " << "\n";
      PrintVectorOfVectors(open);
      cout << "Solution open list is: " << "\n";
      PrintVectorOfVectors(solution_open);
      cout << "\n";
    } else if (grid != solution_grid) {
      cout << "failed" << "\n";
      cout << "\n";
      cout << "Your grid is: " << "\n";
      PrintVectorOfVectors(grid);
      cout << "\n";
      cout << "Solution grid is: " << "\n";
      PrintVectorOfVectors(solution_grid);
      cout << "\n";
    } else {
      cout << "passed" << "\n";
    }
    return;
  }
  
  void TestCompare() {
    cout << "----------------------------------------------------------" << "\n";
    cout << "Compare Function Test: ";
    vector<int> test_1 {1, 2, 5, 6};
    vector<int> test_2 {1, 3, 5, 7};
    vector<int> test_3 {1, 2, 5, 8};
    vector<int> test_4 {1, 3, 5, 7};
    if (Compare(test_1, test_2)) {
      cout << "failed" << "\n";
      cout << "\n" << "a = ";
      PrintVector(test_1);
      cout << "b = ";
      PrintVector(test_2);
      cout << "Compare(a, b): " << Compare(test_1, test_2) << "\n";
      cout << "Correct answer: 0" << "\n";
      cout << "\n";
    } else if (!Compare(test_3, test_4)) {
      cout << "failed" << "\n";
      cout << "\n" << "a = ";
      PrintVector(test_3);
      cout << "b = ";
      PrintVector(test_4);
      cout << "Compare(a, b): " << Compare(test_3, test_4) << "\n";
      cout << "Correct answer: 1" << "\n";
      cout << "\n";
    } else {
      cout << "passed" << "\n";
    }
    cout << "----------------------------------------------------------" << "\n";
    return;
  }
  