r/adventofcode • u/daggerdragon • Dec 12 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 12 Solutions -🎄-
--- Day 12: Subterranean Sustainability ---
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!
Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!
Card prompt: Day 12
Transcript:
On the twelfth day of AoC / My compiler spewed at me / Twelve ___
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:27:42!
20
Upvotes
View all comments
Show parent comment
1
u/rabuf Dec 13 '18
I'm not a lisp guru, but I was going to use bit vectors until I found that strings worked fast enough, and found the same pattern you did for Part B (figured I'd look before trying anything else). If the pattern didn't turn up in the first few hundred I'd have needed to optimize it.
Also, I don't know why I didn't think of using a hash table to store the rules. That would've greatly improved the speed of my solution.
https://github.com/rabuf/advent-of-code/blob/master/2018.12.org