Advent of Code 2026: Day 02 0 ▲ Daniel Nitsikopoulos 1 day ago · Gaming · hide A little bit trickier today!Part 1:Now that we have all our thingamajigs and gizmos from Day 1, it's time to do some farming! We come across some elves who are tinkering with a robot that follows a rainbow of waypoints 🌈 (such as roygbv ). Every robot starts at red (r) and has a series of instructions that sees it travelling forward to the next waypoint of that instruction's colour.So instructions of ryvv will see the robot travel 2 places to yellow (y) , then 2 more to violet (v) but then 6 more places to the next violet (v) waypoint. The elves want to know how far a robot will go given some program.def part1(input) program = input.first.split("") waypoints = %w[r o y g b v] count_distance(program, waypoints, "r") end def count_distance(program, waypoints, starting_waypoint) prev_waypoint = starting_waypoint program.map do |nxt| res = waypoints.rotate(waypoints.index(prev_waypoint)).index(nxt) prev_waypoint = nxt res.zero? ? 6 : res end.inject(:+) end⭐️ Rather creating a massive list… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town