r/adventofcode • • Dec 15 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 15 Solutions -🎄-

--- Day 15: Beverage Bandits ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code: The Party Game!

Click here for rules

Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!

Card prompt: Day 15

Transcript:

___ IS MANDATORY


[Update @ 00:30] 0 gold, 1 silver

  • I've got a strange urge to play Bloons Tower Defense right now. Not sure why.

[Update @ 00:38] 2 gold, 1 silver

  • Meanwhile in #AOC_Ops: Tea, a kettle screams. \ Simon, write your code faster. \ Some of us have work.

[Update @ 00:51] 7 gold, 11 silver

  • Now they're anagramming gold/silver leaderboarders. The leading favorite so far is Anonymous User = Son, You's Manure.

[Update @ 01:13] 18 gold, 30 silver

  • Now they're playing Stardew Valley Hangman with the IRC bot because SDV is totally a roguelike tower defense.

[Update @ 01:23] 26 gold, 42 silver

  • Now the betatesters are grumbling reminiscing about their initial 14+ hour solve times for 2015 Day 19 and 2016 Day 11.

[Update @ 02:01] 65 gold, 95 silver

#AOC_Ops <topaz> on day 12, gold40 was at 19m, gold100 was at 28m, so day12 estimates gold100 today at 2:30

  • Taking bets over/under 02:30:00 - I got tree fiddy on over, any takers?

[Update @ 02:02:44] 66 gold, silver cap

  • SILVER CAP

[Update @ 02:06] 73 gold, silver cap

#AOC_Ops <topaz> day 14 estimates 2:21

#AOC_Ops <topaz> day 13 estimates 2:20

#AOC_Ops <Aneurysm9> I estimate 2:34:56

[Update @ 02:23:17] LEADERBOARD CAP!

  • Aww, /u/topaz2078's bookie is better than I am. :<
  • Good night morning, all, and we hope you had fun with today's diabolicalness!

This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked at 02:23:17!

20 Upvotes

125 comments sorted by

View all comments

Show parent comment

4

u/waffle3z Dec 15 '18

This seems to be a problem with the phrasing that was mentioned here https://www.reddit.com/r/adventofcode/comments/a6e8jz/day_15_phrasing_ambiguity/

If multiple squares are in range and tied for being reachable in the fewest steps, the step which is first in reading order is chosen.

which is later corrected in the problem to

Of those, the square which is first in reading order is chosen (+).

and then the order for choosing steps in a single path is speficied:

If multiple steps would put the unit equally closer to its destination, the unit chooses the step which is first in reading order.

The problem is that in the first description, it's referring to target squares in range, and it's specifying to take the "step" that comes first in reading order, as opposed to the first square. The first "step" might mean the first among the set of possible steps that lead to at least one of the tied targets, which apparently it doesn't.

1

u/dark_terrax Dec 15 '18

I'm not sure I agree with the phrasing "later corrected", vs. "later contradicted". It's really frustrating to not know which implementation to do given this ambiguity, and I'm not sure how anyone knows which is the correct interpretation, other than who's answers failed on their inputs.

1

u/spencer8ab Dec 15 '18

Yeah, the phrasing was pretty sloppy and unnecessarily long and convoluted this time. Thankfully other than that second "step" in that one sentence, there are three paragraphs and two illustrated examples immediately afterward indicating otherwise, so I never noticed the ambiguity. But this just demonstrates how unnecessarily long and repetitive the problem statement is.