aboutsummaryrefslogtreecommitdiff
path: root/src/2015/day16/aoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/2015/day16/aoc.cpp')
-rw-r--r--src/2015/day16/aoc.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/2015/day16/aoc.cpp b/src/2015/day16/aoc.cpp
index 2adfe7c..9d1ac4a 100644
--- a/src/2015/day16/aoc.cpp
+++ b/src/2015/day16/aoc.cpp
@@ -1,3 +1,17 @@
#include "aoc.h"
namespace aoc2015 {
+
+bool like(const sue& s1, const sue& s2) { return s1.like(s2); }
+bool like_range(const sue& s1, const sue& s2) { return s1.like_range(s2); }
+
+std::pair<int, int> day16(line_view file) {
+ aunts as;
+ per_line(file, [&as](line_view lv) {
+ as.parse(lv);
+ return true;
+ });
+
+ sue x{3, 7, 2, 3, 0, 0, 5, 3, 2, 1};
+ return {as.filter(x, like), as.filter(x, like_range)};
}
+} // namespace aoc2015