r/adventofcode • u/daggerdragon • Dec 17 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 17 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
- 5 days remaining until the submission deadline on December 22 at 23:59 EST
- Full details and rules are in the Submissions Megathread
--- Day 17: Conway Cubes ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks. - The full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:13:16, megathread unlocked!
34
Upvotes
View all comments
Show parent comment
1
u/DFreiberg Dec 17 '20
You're probably right -
CellularAutomaton[]was the first thing I checked, but every time I've tried using it in the past I've been burned by the fact that it assumes that inputs wrap 'wrap around' rather than having a definite edge, or being able to expand indefinitely (though as I type this I've just realized that I could make the array large enough to begin with that no wrapping occurs, just like I did withSparseArray[]today).Plus, you'd have to generate either the rule number or the full list of substitutions, and there's usually a twist of some kind in part 2, and often
CellularAutomaton[]can't scale, or can't easily scale, to fit the problem; day 11 of this year being a perfect example. Between it all I've just never found it easier (aside from the 2D case) to use the built-ins for this than to just make my own and be done with it.That said, what kind of input is your code expecting? I tried filling it with mine (replaced by 1s and 0s, of course) and got a syntax error from
CellularAutomaton[]about the initial condition specifications that I don't quite understand.