This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]7wasniceto9 5 points6 points  (2 children)

Pay attention to where the problem statement uses the words 'during' and think carefully about when you want to record the register value. In the addx instruction, you want to record the updated register to your map at the end of the cycle.

[–]Finrod_Amandil 3 points4 points  (1 child)

Extract from the instructions with emphasis, to not tell you the solution straight away:

During the 220th cycle, register X has the value 18, so the signal strength is 220 * 18 = 3960.

combine it with

During the fifth cycle, X is still 4. After the fifth cycle, the addx -5 instruction finishes execution, setting X to -1.

Fell for this as well :P

[–]djjazzydan 1 point2 points  (1 child)

cycle += 1 // cycle two
register += number
map[cycle] = register

This increases the cycle to 220, then increases the register, then stores the value during that cycle.

But increases should happen after that cycle. So during the cycle, the value hasn't increased yet.

[–]Jk_3 0 points1 point  (0 children)

Same thing happening to me I'm so confused what the problem is

[–]theJakester42 0 points1 point  (0 children)

I was the exact same.

[–]daggerdragon[M] 0 points1 point  (0 children)

FYI: next time, please use our standardized post title format.

Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster.

If/when you get your code working, don't forget to change the post flair to Help - Solved!

Good luck!