aboutsummaryrefslogtreecommitdiff
path: root/src/2022/day12/aoc.cpp
blob: 7b79e94819317ac4586d67dbbbaf0fa603427f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "aoc.h"
#include <algorithm>

namespace aoc2022 {

std::pair<int, int> day12(line_view file) {
  int row{0};
  heightmap hm;
  per_line(file, [&hm, &row](line_view lv){
      hm.load(row++, lv);
      return true;
  });

  // hm.print();
  std::vector<heightmap::pos> ps;
  hm.find_prev(0, hm.end, ps);

  for (auto &p : ps) {
    printf("%d %d\n", p.x, p.y);
  }
  return {0, 0};
}

}