Add solution for "Day 17: Chronospatial Computer", part 2
This commit is contained in:
@@ -37,4 +37,5 @@ class ChronospatialComputer
|
||||
std::array<std::unique_ptr<ChronospatialComputerInstruction>, 8> instructions_;
|
||||
std::vector<int> program_;
|
||||
ChronospatialComputerState state_;
|
||||
long long findQuineState();
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@ class ChronospatialComputerInstruction
|
||||
protected:
|
||||
virtual void runValue(ChronospatialComputerState& state, const int operandValue) const = 0;
|
||||
private:
|
||||
std::function<int(const std::array<int, 3>&, const int)> operandFunctor_;
|
||||
std::function<int(const std::array<long long, 3>&, const int)> operandFunctor_;
|
||||
};
|
||||
|
||||
#pragma region ChronospatialComputerDivisionInstruction
|
||||
|
||||
@@ -22,6 +22,6 @@ class ChronospatialComputerState
|
||||
{
|
||||
public:
|
||||
size_t instructionPointer{ 0 };
|
||||
std::array<int, 3> registers{};
|
||||
std::array<long long, 3> registers{};
|
||||
std::ostringstream output{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user