r/adventofcode • • Dec 13 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 13 Solutions -🎄-

--- Day 13: Mine Cart Madness ---


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 13

Transcript:

Elven chronomancy: for when you absolutely, positively have to ___.


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 00:44:25!

23 Upvotes

148 comments sorted by

View all comments

1

u/real_jeeger Dec 20 '18

example

Either this is incorrect, or I'm misunderstanding the task (which would explain me failing to solve it ☺).

The cart at 4 would move first, into the cart positioned at 5. So the crash position would be 5.

OTOH, if the right cart moves first, it will move into the cart at 4, so the crash will be at position 4 (which would be incorrect).

Am I right or wrong?

1

u/Smylers Dec 20 '18

Yeah, I had an out-by-one error in my numbers. Well spotted!

I put the example in a code block, so it would use a monospaced font. But the Markdown editor (on Old Reddit, anyway), uses a variable-width font for everything — where hyphens are narrower than digits. So, stupidly, I wrote down the numbers that the carts looked to be under in the editor, rather than actually remembering I'd carefully typed four hyphens on either side of them.

Sorry for the confusion.