|
|
@ -28,7 +28,7 @@ pair<string, string> solve3(istream& input) { |
|
|
uint64_t part1; |
|
|
uint64_t part1; |
|
|
for (auto slope : slopes) { |
|
|
for (auto slope : slopes) { |
|
|
uint64_t total_trees = 0; |
|
|
uint64_t total_trees = 0; |
|
|
for (auto pos = pair(0, 0); pos.second < my_map.size(); ) { |
|
|
|
|
|
|
|
|
for (auto pos = pair<uint64_t, uint64_t>(0, 0); pos.second < my_map.size(); ) { |
|
|
total_trees += (int) my_map[pos.second][pos.first] == '#'; |
|
|
total_trees += (int) my_map[pos.second][pos.first] == '#'; |
|
|
pos.first = (pos.first + slope.first) % width; |
|
|
pos.first = (pos.first + slope.first) % width; |
|
|
pos.second += slope.second; |
|
|
pos.second += slope.second; |
|
|
|