User's banner
Avatar

hal9001

hal9001@lemmy.world
Joined
30 posts • 76 comments

Hey Folks!

I’ve escaped Reddit and fled to the fediverse (and trying really hard to not look back).

My interests are all over with a small subset being:

  • Programming Language Design
  • Rust
  • Clojure
  • Game Dev
  • Cooking
  • Baking (especially bread)
  • Gaming
Direct message

That got me! Ended up with some very very big numbers

permalink
report
reply

Ranges are always pesky. Lots of off by one errors when I was pulling this one together. It was also the first day I caved and broke out atoms

clojure solution

permalink
report
reply

This one was a high school flashback. Ended up using the quadratic formula to find the root of the curve.

clojure solution

permalink
report
reply

Recursion probably made things a little trickier for you (but is totally possible). The special piece to notice in part 2 is that you are only forward creating cards and (most importantly) there are no decisions to optimize. Each card alway produces the same result.

This problem reminded me of the lantern fish problem. The trick with this one was not tracking individual fish, instead you only need the number of each generation you have (and in today’s puzzle we just need to track how many of each card you have)

permalink
report
parent
reply

My clojure solution

Ran into a couple gottchas today. Didn’t notice the tabular data at first. It got me twice, once on the numbers and then again on the card number (which I guess I didn’t actually need to use)

The second gottcha was missing that in the second part it is the number of matching numbers not the score that I needed to use. My first attempt was a very very very big number

permalink
report
reply

My clojure solution

That was a fun one to parse. Needed to leak some mutability into my code using the raw Java Matcher as there wasn’t another way to get the indexes of the matches in the string. Luckily it’s contained within a fn so not too bad :D

permalink
report
reply

Here is my clojure solution

Back to a more typical difficulty today ❄️

permalink
report
reply

My clojure solution

Part 2 was unexpected. Was not expecting that level of wrinkle on day 1 for sure.

I saw a few things that were guessing we might have a lot more of these sorts of twists to help throw off the AI solutions 🤷‍♂️

permalink
report
reply

Thanks for the shout out!

I remember this being a really tricky one to tweak. It’s always around 18-20 when things really ramp up. I still haven’t braved: https://adventofcode.com/2018/day/15

This is a great set of data plots to see all the tricky problems 😁 https://www.maurits.vdschee.nl/scatterplot/

permalink
report
reply

If you are interested I wrote an AoC helper last year for clojure. https://github.com/jjcomer/aoc-helper

I started with the idea of using babashka for everything, but I ran into some namespace issues.

permalink
report
parent
reply