mirror of
https://github.com/mfocko/blog.git
synced 2024-11-13 01:30:29 +01:00
35 lines
1 KiB
C++
35 lines
1 KiB
C++
|
#include <iostream>
|
||
|
#include <string>
|
||
|
#include <utility>
|
||
|
#include <vector>
|
||
|
|
||
|
#include "astar.hpp"
|
||
|
#include "bf.hpp"
|
||
|
#include "dijkstra.hpp"
|
||
|
#include "graph.hpp"
|
||
|
|
||
|
auto line_to_vector(const std::string& l) -> std::vector<char> {
|
||
|
return std::vector(l.begin(), l.end());
|
||
|
}
|
||
|
|
||
|
auto main() -> int {
|
||
|
graph g{std::vector{
|
||
|
line_to_vector(std::string("#############")),
|
||
|
line_to_vector(std::string("#..#..*.*.**#")),
|
||
|
line_to_vector(std::string("##***.....**#")),
|
||
|
line_to_vector(std::string("#..########.#")),
|
||
|
line_to_vector(std::string("#...###...#.#")),
|
||
|
line_to_vector(std::string("#..#...##.#.#")),
|
||
|
line_to_vector(std::string("#..#.*.#..#.#")),
|
||
|
line_to_vector(std::string("#....#....#.#")),
|
||
|
line_to_vector(std::string("########*.*.#")),
|
||
|
line_to_vector(std::string("#...........#")),
|
||
|
line_to_vector(std::string("#############")),
|
||
|
}};
|
||
|
std::cout << "Normal cost: " << g.normal_cost() << "\n";
|
||
|
std::cout << "Vortex cost: " << g.vortex_cost() << "\n";
|
||
|
std::cout << "Graph:\n" << g;
|
||
|
|
||
|
return 0;
|
||
|
}
|