@@ -103,10 +103,9 @@ func process(registers []Register, program []int) []int {
case 5:
results = append(results, getCombo(program[instructionPointer+1], registers)%8)
case 6:
- registers[1].value = registers[0].value / (getCombo(program[instructionPointer+1], registers) * getCombo(program[instructionPointer+1], registers))
+ registers[1].value = registers[0].value / (powerOfTwo(getCombo(program[instructionPointer+1], registers)))
case 7:
- registers[3].value = registers[0].value / (getCombo(program[instructionPointer+1], registers) * getCombo(program[instructionPointer+1], registers))
-
+ registers[2].value = registers[0].value / (powerOfTwo(getCombo(program[instructionPointer+1], registers)))
}
instructionPointer += 2
@@ -0,0 +1,5 @@
+Register A: 22817223
+Register B: 0
+Register C: 0
+
+Program: 2,4,1,2,7,5,4,5,0,3,1,7,5,5,3,0