-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (39 loc) · 1000 Bytes
/
main.cpp
File metadata and controls
52 lines (39 loc) · 1000 Bytes
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
46
47
48
49
50
51
52
#include <iostream>
#include "astar.h"
void astar_callback() {
char filename[256];
std::cout << "input file name." << std::endl;
std::cin >> filename;
int mode;
std::cout << "select mode." << std::endl;
std::cout << "1: non-stop." << std::endl;
std::cout << "2: step run." << std::endl;
std::cin >> mode;
while (mode != 1 && mode != 2) {
std::cout << "please input 1 or 2." << std::endl;
std::cin >> mode;
}
Astar hoge(filename);
Coord std_node;
hoge.InputMap();
hoge.OpenStart();
std_node = hoge.SearchStdNode();
hoge.OpenAround(std_node);
if (mode == 2) hoge.debugPrintStatus();
while (hoge.CheckGoal()) {
if (mode == 2) {
std::cout << "1: finish stepping." << std::endl;
std::cout << "2: continue stepping." << std::endl; std::cin >> mode;
}
std_node = hoge.SearchStdNode();
hoge.OpenAround(std_node);
if (mode == 2)hoge.debugPrintStatus();
}
hoge.FindPath();
hoge.DeleteMap();
}
int main()
{
astar_callback();
return 0;
}