mirror of https://github.com/dnomd343/klotski.git
Dnomd343
2 years ago
7 changed files with 71 additions and 51 deletions
@ -0,0 +1,4 @@ |
|||
cmake_minimum_required(VERSION 3.0) |
|||
|
|||
add_library(graph graph.cc) |
|||
target_link_libraries(graph analyse) |
@ -0,0 +1,30 @@ |
|||
#include "graph.h" |
|||
|
|||
#include <iostream> |
|||
|
|||
void Graph::svg_demo(Analyse::track_data_t track_data) { |
|||
|
|||
|
|||
for (uint32_t i = 0; i < track_data.size(); ++i) { |
|||
|
|||
const auto &ly = track_data[i]; |
|||
|
|||
std::cout << std::endl; |
|||
std::cout << "----------------------------------"; |
|||
std::cout << " layer " << i << " "; |
|||
std::cout << "----------------------------------" << std::endl; |
|||
|
|||
for (const auto &c : ly) { |
|||
for (const auto &l : c.second.last) { |
|||
std::cout << l->code << " "; |
|||
} |
|||
std::cout << " <- [" << c.second.code << "] -> "; |
|||
for (const auto &n : c.second.next) { |
|||
std::cout << n->code << " "; |
|||
} |
|||
std::cout << std::endl; |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,11 @@ |
|||
#pragma once |
|||
|
|||
#include "analyse.h" |
|||
|
|||
class Graph { |
|||
|
|||
public: |
|||
|
|||
void svg_demo(Analyse::track_data_t track_data); |
|||
|
|||
}; |
Loading…
Reference in new issue