-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (39 loc) · 1015 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// g++ -g -Wall main.cpp node.cpp solve.cpp -o solve -lsfml-graphics -lsfml-window -lsfml-system
#include <chrono>
#include <iostream>
#include <utility>
#include <vector>
#include <cassert>
#include <cmath>
#include "solve.h"
int main(int argc, char* argv[]) {
if(argc < 2) {
std::cerr << "Not enough arguments\n";
exit(1);
}
mazeType maze;
bool debug = false;
bool trim = false;
for(int i = 1; i < argc; ++i) {
if(std::string(argv[i]) == "-visualize")
maze.visualize = true;
else if(std::string(argv[i]) == "-dijkstra")
maze.dijkstra = true;
else if(std::string(argv[i]) == "-A*")
maze.dijkstra = false;
else if(std::string(argv[i]) == "-trim")
trim = true;
else if(std::string(argv[i]) == "-debug")
debug = true;
else
maze.mazeName = std::string(argv[i]);
}
if(debug)
debugMaze(maze.mazeName);
else if(trim)
trimMaze(maze.mazeName);
else if(maze.visualize)
solveVisualized(maze);
else
solveDijkstra(maze);
}