Add includes of cassert
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -7,7 +8,10 @@ using Int = long;
|
|||||||
|
|
||||||
struct Vector
|
struct Vector
|
||||||
{
|
{
|
||||||
Vector(Int x, Int y, Int z) : x_(x), y_(y), z_(z) {}
|
Vector(Int x, Int y, Int z)
|
||||||
|
: x_(x), y_(y), z_(z)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Int x() const noexcept { return x_; }
|
Int x() const noexcept { return x_; }
|
||||||
Int y() const noexcept { return y_; }
|
Int y() const noexcept { return y_; }
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = long;
|
using Int = long;
|
||||||
using StateName = char;
|
using StateName = char;
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = std::int64_t;
|
using Int = std::int64_t;
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using UInt = std::uint64_t;
|
using UInt = std::uint64_t;
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 01/12/2022.
|
// Created by Matthew Gretton-Dann on 01/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 01/12/2022.
|
// Created by Matthew Gretton-Dann on 01/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 01/12/2022.
|
// Created by Matthew Gretton-Dann on 01/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 01/12/2022.
|
// Created by Matthew Gretton-Dann on 01/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = std::int64_t;
|
using Int = std::int64_t;
|
||||||
using UInt = std::uint64_t;
|
using UInt = std::uint64_t;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using UInt = unsigned long;
|
using UInt = unsigned long;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ struct Item
|
|||||||
UInt value_;
|
UInt value_;
|
||||||
unsigned depth_;
|
unsigned depth_;
|
||||||
};
|
};
|
||||||
|
|
||||||
using Items = std::vector<Item>;
|
using Items = std::vector<Item>;
|
||||||
|
|
||||||
auto print1(Items::const_iterator begin, Items::const_iterator end, unsigned current_depth)
|
auto print1(Items::const_iterator begin, Items::const_iterator end, unsigned current_depth)
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using UInt = unsigned long;
|
using UInt = unsigned long;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ struct Item
|
|||||||
UInt value_;
|
UInt value_;
|
||||||
unsigned depth_;
|
unsigned depth_;
|
||||||
};
|
};
|
||||||
|
|
||||||
using Items = std::vector<Item>;
|
using Items = std::vector<Item>;
|
||||||
|
|
||||||
auto print1(Items::const_iterator begin, Items::const_iterator end, unsigned current_depth)
|
auto print1(Items::const_iterator begin, Items::const_iterator end, unsigned current_depth)
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct State
|
struct State
|
||||||
{
|
{
|
||||||
explicit State(std::string const& rules) : rules_(rules)
|
explicit State(std::string const& rules)
|
||||||
|
: rules_(rules)
|
||||||
{
|
{
|
||||||
assert(rules.size() == 512);
|
assert(rules.size() == 512);
|
||||||
assert(rules[0] == '.' || rules[511] == '.');
|
assert(rules[0] == '.' || rules[511] == '.');
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct State
|
struct State
|
||||||
{
|
{
|
||||||
explicit State(std::string const& rules) : rules_(rules)
|
explicit State(std::string const& rules)
|
||||||
|
: rules_(rules)
|
||||||
{
|
{
|
||||||
assert(rules.size() == 512);
|
assert(rules.size() == 512);
|
||||||
assert(rules[0] == '.' || rules[511] == '.');
|
assert(rules[0] == '.' || rules[511] == '.');
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -124,6 +125,7 @@ struct State
|
|||||||
get(new_scorex, scorey, new_posx, posy) += states;
|
get(new_scorex, scorey, new_posx, posy) += states;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void move_player2(unsigned scorex, unsigned scorey, unsigned posx, unsigned posy, unsigned amount,
|
void move_player2(unsigned scorex, unsigned scorey, unsigned posx, unsigned posy, unsigned amount,
|
||||||
UInt states)
|
UInt states)
|
||||||
{
|
{
|
||||||
@@ -148,6 +150,7 @@ private:
|
|||||||
return data_[scorey * target_score * loop_size * loop_size + scorex * loop_size * loop_size +
|
return data_[scorey * target_score * loop_size * loop_size + scorex * loop_size * loop_size +
|
||||||
(posy - 1) * loop_size + (posx - 1)];
|
(posy - 1) * loop_size + (posx - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto get(unsigned scorex, unsigned scorey, unsigned posx, unsigned posy) noexcept -> UInt&
|
auto get(unsigned scorex, unsigned scorey, unsigned posx, unsigned posy) noexcept -> UInt&
|
||||||
{
|
{
|
||||||
return data_[scorey * target_score * loop_size * loop_size + scorex * loop_size * loop_size +
|
return data_[scorey * target_score * loop_size * loop_size + scorex * loop_size * loop_size +
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#define ADVENT_OF_CODE_GRAPH_UTILS_H
|
#define ADVENT_OF_CODE_GRAPH_UTILS_H
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cassert>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = std::int64_t;
|
using Int = std::int64_t;
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 02/12/2022.
|
// Created by Matthew Gretton-Dann on 02/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 02/12/2022.
|
// Created by Matthew Gretton-Dann on 02/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 02/12/2022.
|
// Created by Matthew Gretton-Dann on 02/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using UInt = std::uint64_t;
|
using UInt = std::uint64_t;
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 05/12/2021.
|
// Created by Matthew Gretton-Dann on 05/12/2021.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 07/12/2022.
|
// Created by Matthew Gretton-Dann on 07/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 07/12/2022.
|
// Created by Matthew Gretton-Dann on 07/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 08/12/2022.
|
// Created by Matthew Gretton-Dann on 08/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 08/12/2022.
|
// Created by Matthew Gretton-Dann on 08/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 09/12/2022.
|
// Created by Matthew Gretton-Dann on 09/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -18,17 +19,20 @@ enum class Op { undef, add, mult, dbl, square };
|
|||||||
struct Monkey
|
struct Monkey
|
||||||
{
|
{
|
||||||
auto add_item(UInt score) { items_.push_back(score); }
|
auto add_item(UInt score) { items_.push_back(score); }
|
||||||
|
|
||||||
auto op(Op op)
|
auto op(Op op)
|
||||||
{
|
{
|
||||||
assert(op == Op::dbl || op == Op::square);
|
assert(op == Op::dbl || op == Op::square);
|
||||||
op_ = op;
|
op_ = op;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto op(Op op, UInt amt)
|
auto op(Op op, UInt amt)
|
||||||
{
|
{
|
||||||
assert(op == Op::add || op == Op::mult);
|
assert(op == Op::add || op == Op::mult);
|
||||||
op_ = op;
|
op_ = op;
|
||||||
amt_ = amt;
|
amt_ = amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto test(UInt test) { test_ = test; }
|
auto test(UInt test) { test_ = test; }
|
||||||
auto true_monkey(UInt monkey) { true_monkey_ = monkey; }
|
auto true_monkey(UInt monkey) { true_monkey_ = monkey; }
|
||||||
auto false_monkey(UInt monkey) { false_monkey_ = monkey; }
|
auto false_monkey(UInt monkey) { false_monkey_ = monkey; }
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 09/12/2022.
|
// Created by Matthew Gretton-Dann on 09/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 09/12/2022.
|
// Created by Matthew Gretton-Dann on 09/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,7 +22,8 @@ using namespace std::string_literals;
|
|||||||
|
|
||||||
struct Grid3
|
struct Grid3
|
||||||
{
|
{
|
||||||
explicit Grid3(std::size_t size) : size_(size) { map_.resize(size * size * size, false); }
|
explicit Grid3(std::size_t size)
|
||||||
|
: size_(size) { map_.resize(size * size * size, false); }
|
||||||
|
|
||||||
auto point(Point3 const& p) const noexcept -> bool
|
auto point(Point3 const& p) const noexcept -> bool
|
||||||
{
|
{
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -21,7 +22,8 @@ using namespace std::string_literals;
|
|||||||
|
|
||||||
struct Grid3
|
struct Grid3
|
||||||
{
|
{
|
||||||
explicit Grid3(std::size_t size) : size_(size) { map_.resize(size * size * size, ' '); }
|
explicit Grid3(std::size_t size)
|
||||||
|
: size_(size) { map_.resize(size * size * size, ' '); }
|
||||||
|
|
||||||
auto point(Point3 const& p) const noexcept -> char
|
auto point(Point3 const& p) const noexcept -> char
|
||||||
{
|
{
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = std::int64_t;
|
using Int = std::int64_t;
|
||||||
using UInt = std::uint64_t;
|
using UInt = std::uint64_t;
|
||||||
@@ -19,7 +20,10 @@ struct Monkey
|
|||||||
{
|
{
|
||||||
Monkey() = default;
|
Monkey() = default;
|
||||||
|
|
||||||
explicit Monkey(Int value) : value_(value), value_known_(true) {}
|
explicit Monkey(Int value)
|
||||||
|
: value_(value), value_known_(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Monkey(std::string lhs, char op, std::string rhs)
|
Monkey(std::string lhs, char op, std::string rhs)
|
||||||
: lhs_(std::move(lhs)), rhs_(std::move(rhs)), op_(op)
|
: lhs_(std::move(lhs)), rhs_(std::move(rhs)), op_(op)
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using Int = std::int64_t;
|
using Int = std::int64_t;
|
||||||
using UInt = std::uint64_t;
|
using UInt = std::uint64_t;
|
||||||
@@ -19,7 +20,10 @@ struct Monkey
|
|||||||
{
|
{
|
||||||
Monkey() = default;
|
Monkey() = default;
|
||||||
|
|
||||||
explicit Monkey(Int value) : value_(value), value_known_(true) {}
|
explicit Monkey(Int value)
|
||||||
|
: value_(value), value_known_(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Monkey(std::string lhs, char op, std::string rhs)
|
Monkey(std::string lhs, char op, std::string rhs)
|
||||||
: lhs_(std::move(lhs)), rhs_(std::move(rhs)), op_(op)
|
: lhs_(std::move(lhs)), rhs_(std::move(rhs)), op_(op)
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -150,7 +151,7 @@ auto main() -> int
|
|||||||
grid.push_back(line);
|
grid.push_back(line);
|
||||||
max_row_length = std::max(max_row_length, line.size());
|
max_row_length = std::max(max_row_length, line.size());
|
||||||
}
|
}
|
||||||
for (auto& row : grid) { row.resize(max_row_length, ' ');};
|
for (auto& row : grid) { row.resize(max_row_length, ' '); };
|
||||||
|
|
||||||
std::string instructions;
|
std::string instructions;
|
||||||
if (!std::getline(std::cin, instructions)) {
|
if (!std::getline(std::cin, instructions)) {
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -160,6 +161,7 @@ auto calc_score(Grid const& grid) -> UInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
|
|
||||||
auto main() -> int
|
auto main() -> int
|
||||||
{
|
{
|
||||||
std::string line;
|
std::string line;
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -160,6 +161,7 @@ auto calc_score(Grid const& grid) -> UInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
|
|
||||||
auto main() -> int
|
auto main() -> int
|
||||||
{
|
{
|
||||||
std::string line;
|
std::string line;
|
||||||
@@ -206,6 +208,6 @@ auto main() -> int
|
|||||||
|
|
||||||
UInt const score{calc_score(grid)};
|
UInt const score{calc_score(grid)};
|
||||||
std::cout << "Score: " << score << "\n";
|
std::cout << "Score: " << score << "\n";
|
||||||
std::cout << "Number of turns: " << num_rounds<< "\n";
|
std::cout << "Number of turns: " << num_rounds << "\n";
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// Created by Matthew Gretton-Dann on 16/12/2022.
|
// Created by Matthew Gretton-Dann on 16/12/2022.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
Reference in New Issue
Block a user