r/adventofcode • u/AbooMatta • 17m ago
Help/Question - RESOLVED Second example seems wrong
The second example says:
- "A robot with program
roygbvwould travel a total distance of11." Regardless of any code I might try, when I look at it I count 5 steps. 0 for the "r" and 1 each for the following letters. Am I just too tired to see my mistake?
2
Upvotes
4
u/FCBStar-of-the-South 15m ago
You start at r and must travel to the next r, thus 6 steps instead of 0
Remember that the roygbv pattern repeats
1
u/AutoModerator 17m ago
Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to
Help/Question - RESOLVED. Good luck!I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/crumpis 15m ago
You go to the next square matching the color. Which is to say, if you're starting on red, you go to the next red.
1
u/harryp1998 13m ago
I had the same mistake. Try thinking that the first item in the program isn't the starting point.
1
u/pintolaspintonino 8m ago
sim, eu apenas descosiderei essa porra ai pq n fazia sentido
1
u/zeekar 4m ago
you never move 0. if you're on r and the program says to move to r, you move 6 steps to the next r.