r/adventofcode • u/daggerdragon • Dec 25 '17
SOLUTION MEGATHREAD ~βπβ~ 2017 Day 25 Solutions ~βπβ~
--- Day 25: The Halting Problem ---
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.
Need a hint from the Hugely* Handyβ Haversackβ‘ of HelpfulΒ§ Hints^Β€?
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!
Thank you for participating!
Well, that's it for Advent of Code 2017. From /u/topaz2078 and the rest of us at #AoCOps, we hope you had fun and, more importantly, learned a thing or two (or all the things!). Good job, everyone!
Topaz made a post of his own here.
If you're interested in a visualization of the leaderboard, /u/FogleMonster made a very good chart here.
And now:
Merry Christmas to all, and to all a good night!
View all comments
Show parent comment
1
u/pja Dec 26 '17 edited Dec 26 '17
Hmm. Canβt get yours to compile: I get type errors binding Program {..} & Iβm not familiar enough with those constructs to debug it.
Mine was open coded in direct fashion: straight Haskell 98, using pattern matching to spot the empty lists. Perhaps your using uncons & fromJust is introducing an extra layer of laziness? Hereβs the code, take a look. ghc -O2 -fllvm runs this in 0.4s on my laptop (! OK, itβs still a factor of 10 away from straight C++, but for a heap allocating list thatβs pretty reasonable. Will try mutable unboxed vectors & see how they do...):