diff --git a/2016/puzzle-13-01.cc b/2016/puzzle-13-01.cc index bd1443f..8a5391d 100644 --- a/2016/puzzle-13-01.cc +++ b/2016/puzzle-13-01.cc @@ -19,9 +19,9 @@ struct Node return x_ < rhs.x_ || (x_ == rhs.x_ && y_ < rhs.y_); } - Num x() const noexcept { return x_; } - Num y() const noexcept { return y_; } - Num cost() const noexcept { return cost_; } + constexpr Num y() const noexcept { return y_; } + constexpr Num x() const noexcept { return x_; } + constexpr Num cost() const noexcept { return cost_; } Node move_left() { return {x_ - 1, y_, cost_ + 1}; } Node move_up() { return {x_, y_ + 1, cost_ + 1}; } @@ -112,4 +112,4 @@ auto main() -> int std::cout << "No solution.\n"; return 1; -} \ No newline at end of file +} diff --git a/2016/puzzle-13-02.cc b/2016/puzzle-13-02.cc index 60a4ca8..78955f0 100644 --- a/2016/puzzle-13-02.cc +++ b/2016/puzzle-13-02.cc @@ -19,9 +19,9 @@ struct Node return x_ < rhs.x_ || (x_ == rhs.x_ && y_ < rhs.y_); } - Num x() const noexcept { return x_; } - Num y() const noexcept { return y_; } - Num cost() const noexcept { return cost_; } + constexpr Num x() const noexcept { return x_; } + constexpr Num y() const noexcept { return y_; } + constexpr Num cost() const noexcept { return cost_; } Node move_left() { return {x_ - 1, y_, cost_ + 1}; } Node move_up() { return {x_, y_ + 1, cost_ + 1}; } @@ -112,4 +112,4 @@ auto main() -> int std::cout << "Number of visited locations: " << visited.size() << '\n'; return 0; -} \ No newline at end of file +}