diff options
author | kaiwu <kaiwu2004@gmail.com> | 2023-02-07 22:27:08 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2023-02-07 22:27:08 +0800 |
commit | 7754538a62b97cc12948e0c290006e2892a96901 (patch) | |
tree | 8ff56b49d480a82ff602df7c2c493eb68252f5d3 | |
parent | 23968636d9b5d783bee760653d31409014bfed87 (diff) | |
download | advent-of-code-7754538a62b97cc12948e0c290006e2892a96901.tar.gz advent-of-code-7754538a62b97cc12948e0c290006e2892a96901.zip |
2017 day11 fix part1
-rw-r--r-- | src/2017/day11/aoc.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/2017/day11/aoc.cpp b/src/2017/day11/aoc.cpp index 9c6f780..b9b599a 100644 --- a/src/2017/day11/aoc.cpp +++ b/src/2017/day11/aoc.cpp @@ -2,26 +2,6 @@ namespace aoc2017 { -void route(hd in, hd out, int* step) { - constexpr static int steps[6][6] = { - {1, 1, 1, 0, 0, -1}, - {1, 1, 0, 1, -1, 0}, // ne - {1, 0, 1, -1, 1, 0}, // nw - {0, 1, -1, 1, 0, 1}, // se - {0, -1, 1, 0, 1, 1}, // sw - {-1, 0, 0, 1, 1, 1}, - }; - - auto x = static_cast<int>(in); - auto y = static_cast<int>(out); - *step += steps[x][y]; -} - -hd inout(hd x) { - hd d6[] = {hd::s, hd::sw, hd::se, hd::nw, hd::ne, hd::n}; - return d6[static_cast<int>(x)]; -} - std::pair<int64_t, int64_t> day11(line_view file) { std::vector<hd> ds; const char* p0 = file.line; @@ -41,14 +21,6 @@ std::pair<int64_t, int64_t> day11(line_view file) { p1++; } - int step{1}; - for (size_t i = 0; i < ds.size() - 1; i++) { - auto j = i + 1; - hd in = inout(ds[i]); - hd out = ds[j]; - route(in, out, &step); - } - printf("%d\n", step); return {0, 0}; } |