|
I've really been enjoying these puzzles. A lot of them are stuff I've done before through HackerRank or Project Euler, but the Christmas theming does make it more fun. Unfortunately I'm trying to do them in Ruby which I started picking up about 2 weeks ago so it's been harder for me than it ought to be. Day 12 Part 2 has currently broken me over it's knee and told me I'm a naughty boy who's not getting any gifts this year, though. I know how I'd do it in Python or C#, but the way Ruby aggressively passes by value means I'm having a hard time finding a way to traverse the tree while pruning objects off of it. There's probably some simple language feature I'm missing. Any Ruby people have any, uh, pointers that might help? ErIog fucked around with this message at 13:18 on Dec 18, 2015 |
# ¿ Dec 18, 2015 09:41 |
|
|
# ¿ May 12, 2024 17:14 |
|
ErIog posted:I've really been enjoying these puzzles. A lot of them are stuff I've done before through HackerRank or Project Euler, but the Christmas theming does make it more fun. Unfortunately I'm trying to do them in Ruby which I started picking up about 2 weeks ago so it's been harder for me than it ought to be. Lol, so turns out I'm real dumb and was doing recursion in a really stupid way that was breaking everything because I was trying to mix returning bools and returning actual objects in my recursive function. Once I flipped it to either returning or not returning objects based on their child objects I was golden.
|
# ¿ Dec 18, 2015 13:16 |
|
I thought this one was kind of boring at first since it has some similarities to previous permutation puzzles, but Part 2 makes it a lot more interesting.
|
# ¿ Dec 19, 2015 10:13 |