aoc24: add day11

This commit is contained in:
2024-12-11 08:08:46 +01:00
parent 521b3dc806
commit 7ae660566e
10 changed files with 413 additions and 22 deletions

View File

@@ -14,25 +14,6 @@ namespace lpf {
using edge_t = std::pair<class node, class node>;
using edges_t = std::vector<edge_t>;
class node {
public:
node(i32 id, i32 value, edges_t const& edges)
: m_id(id), m_value(value), m_edges(edges) {}
auto operator==(node const& other) const -> bool {
return m_id == other.m_id && m_value == other.m_value;
}
auto id() const -> i32 { return m_id; }
auto value() const -> i32 { return m_value; }
auto edges() const -> edges_t const& { return m_edges; }
private:
i32 m_id;
i32 m_value;
edges_t m_edges;
};
class trail {
public:
trail(std::string const& str) {
@@ -71,6 +52,32 @@ private:
usize m_cols;
std::vector<u8> m_data;
};
class node {
public:
node(i32 id, i32 value, edges_t const& edges)
: m_id(id), m_value(value), m_edges(edges) {}
auto operator==(node const& other) const -> bool {
return m_id == other.m_id && m_value == other.m_value;
}
auto id() const -> i32 { return m_id; }
auto value() const -> i32 { return m_value; }
auto edges() const -> edges_t const& { return m_edges; }
private:
i32 m_id;
i32 m_value;
edges_t m_edges;
};
class graph {
public:
private:
};
}
auto aoc24::day10([[maybe_unused]]std::span<char const*> const& args) -> std::expected<void, aoc::error> {