Add solution for "Day 17: Chronospatial Computer", part 2

This commit is contained in:
2025-05-21 20:34:34 +02:00
parent 5201dcf0bc
commit 45ab5f93ec
9 changed files with 104 additions and 6 deletions

View File

@@ -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;
}