Add solution for "Day 17: Chronospatial Computer", part 2
This commit is contained in:
@@ -22,10 +22,10 @@ ChronospatialComputerInstruction::ChronospatialComputerInstruction(const Chronos
|
||||
switch (type)
|
||||
{
|
||||
case ChronospatialComputerOperandType::Literal :
|
||||
operandFunctor_ = [](const std::array<int, 3>& registers, const int operand) { return operand; };
|
||||
operandFunctor_ = [](const std::array<long long, 3>& registers, const int operand) { return operand; };
|
||||
break;
|
||||
case ChronospatialComputerOperandType::Combo :
|
||||
operandFunctor_ = [](const std::array<int, 3>& registers, const int operand)
|
||||
operandFunctor_ = [](const std::array<long long, 3>& registers, const int operand)
|
||||
{ return operand < 4 ? operand : registers[static_cast<size_t>(operand - 4)]; };
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user