r/adventofcode • • Dec 16 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 16 Solutions -🎄-

--- Day 16: Chronal Classification ---


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 16

Transcript:

The secret technique to beat today's puzzles is ___.


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:39:03!

18 Upvotes

139 comments sorted by

View all comments

Show parent comment

1

u/MasterMedo Jan 03 '19

The idea is all fine and dandy, but I think you lost more than you gained (time writing, nerves, loc, etc.)

Writing is much faster with repetitive patterns when using a powerful text editor.
It actually is shorter contrary to what you claim.
Not to mention readability.

As for reading the input, you could've done it much simpler;

  1. turn every line into sequence of only digits (using regex or own function)
  2. test_cases, program = split input on '\n\n\n\n'
  3. read 3 (4) by 3 (4) lines from test_cases

This approach makes it super readable in my opinion.

cheers!

here is my solution if you're interested.

1

u/surajmanjesh Jan 03 '19

Ah Yes, I see your point. Your solution is neat! It's simpler to understand. I guess I over-engineered my solution.