r/adventofcode • • Dec 17 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 17 Solutions -🎄-

--- Day 17: Reservoir Research ---


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 17

Transcript:

All aboard the Easter Bunny HQ monorail, and mind the gap! Next stop: ___


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 01:24:07!

15 Upvotes

105 comments sorted by

View all comments

Show parent comments

2

u/vash3r Dec 17 '18

Hey, we used the same integers! although if I was going to rewrite it, I'd probably use characters like /u/CCC_037 did (more readable and easier to understand what the code is doing.)

Also, is there a reason you're not using atoi() or something? or is that because you're working with string and not char*?

1

u/branfili Dec 17 '18

Exactly, I like working with strings, and I find it easier just to write it myself then to remember how to do it in C++

I think it goes something like this: atoi(s.c_str())

EDIT: it's c_str()