Adding the completion of day 3
This commit is contained in:
@@ -40,3 +40,27 @@ For example:
|
||||
^>v< delivers presents to 4 houses in a square, including twice to the house at his starting/ending location.
|
||||
^v^v^v^v^v delivers a bunch of presents to some very lucky children at only 2 houses.
|
||||
|
||||
|
||||
|
||||
Your puzzle answer was 2565.
|
||||
|
||||
The first half of this puzzle is complete! It provides one gold star: *
|
||||
--- Part Two ---
|
||||
|
||||
The next year, to speed up the process, Santa creates a robot version of himself, Robo-Santa, to deliver presents with him.
|
||||
|
||||
Santa and Robo-Santa start at the same location (delivering two presents to the same starting house), then take turns moving based on instructions from the elf, who is eggnoggedly reading from the same script as the previous year.
|
||||
|
||||
This year, how many houses receive at least one present?
|
||||
|
||||
For example:
|
||||
|
||||
^v delivers presents to 3 houses, because Santa goes north, and then Robo-Santa goes south.
|
||||
^>v< now delivers presents to 3 houses, and Santa and Robo-Santa end up back where they started.
|
||||
^v^v^v^v^v now delivers presents to 11 houses, with Santa going one direction and Robo-Santa going the other.
|
||||
|
||||
|
||||
PART 2 COMMENTS
|
||||
I may have spoken too soon about liking having only one struct in play. I think that I'm going to stick with it though. Debate is as to whether or not to add extra fields to the first struct, or to create a new struct with different fields. I think that the move functions are basically sound at this point and ought to be able to be expanded to switch between 2 different cursors - this was fairly straightforwards. I debated adding support for an arbitrary number of cursors, but that seemed like overkill, although judicious struct modification would have enabled it
|
||||
|
||||
Your puzzle answer was 2639.
|
||||
|
Reference in New Issue
Block a user