forked from daancode/a-star
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (22 loc) · 650 Bytes
/
main.cpp
File metadata and controls
24 lines (22 loc) · 650 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
#include <iostream>
#include "source/AStar.hpp"
int main()
{
AStar::Generator generator;
generator.setWorldSize({500, 500});
generator.setWeight(10);
generator.setHeuristic(AStar::Heuristic::manhattan);
generator.setDiagonalMovement(true);
{
auto path = generator.findPath({0, 0}, {499, 499});
for(auto& coordinate : path) {
std::cout << coordinate.x << " " << coordinate.y << "\n";
}
}
{
auto path = generator.findPathStack({0, 0}, {499, 499});
for(auto& coordinate : path) {
std::cout << coordinate.x << " " << coordinate.y << "\n";
}
}
}