aboutsummaryrefslogtreecommitdiff
path: root/src/2015/day3/aoc.h
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2022-03-15 14:43:26 +0800
committerkaiwu <kaiwu2004@gmail.com>2022-03-15 14:43:26 +0800
commitac57557d101f8b7c75e9350712daf16e9b956613 (patch)
tree78a1d4e8673237aca1b99f810c45952d72635c0c /src/2015/day3/aoc.h
parent1a768c1b8d69986c1cafcf5ead8a1f0424cefcbe (diff)
downloadadvent-of-code-ac57557d101f8b7c75e9350712daf16e9b956613.tar.gz
advent-of-code-ac57557d101f8b7c75e9350712daf16e9b956613.zip
day3
Diffstat (limited to 'src/2015/day3/aoc.h')
-rw-r--r--src/2015/day3/aoc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/2015/day3/aoc.h b/src/2015/day3/aoc.h
new file mode 100644
index 0000000..105cf9f
--- /dev/null
+++ b/src/2015/day3/aoc.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "common.h"
+
+namespace aoc2015 {
+
+enum class dir { up, down, left, right };
+
+struct house {
+ int x;
+ int y;
+
+ bool operator<(const house& h) const noexcept { return x < h.x ? true : (x > h.x ? false : y < h.y); }
+};
+
+house move_day3(house, dir);
+std::pair<size_t, size_t> day3(line_view);
+
+} // namespace aoc2015