Advent Of Code 2024

Inspired by @tobyk , I decided to try the Advent of Code challenge. In general, it’s quite fascinating!

I’ll be posting patches and screenshots here for anyone interested. If you want to share your patches here, that would be cool! Join in.

Screenshots

— Day 1: Historian Hysteria —

— Day 2: Red-Nosed Reports —

— Day 3: Mull It Over —

— Day 1: Historian Hysteria —
AOC_1A.vl (47.1 KB)
AOC_1B.vl (46.3 KB)

— Day 2: Red-Nosed Reports —
AOC_2A.vl (72.5 KB)
AOC_2B.vl (79.2 KB)

— Day 3: Mull It Over —
AOC_3A.vl (37.1 KB)
AOC_3B.vl (41.6 KB)

14 Likes

Hi Yar

Great to have you on board, I look forward to checking your solutions!

Mine are here on github

Or you can get the nuget with

nuget install vl.tk.adventofcode24

Watch past streams of me plodding through (and failing!) here

13 Likes

— Day 4: Ceres Search —

It even worked out with a nice visualisation while debugging.


AOC_4A.vl (155.6 KB)

AOC_4B.vl (178.6 KB)

7 Likes

— Day 5: Print Queue —

AOC_5A.vl (93.8 KB)
AOC_5B.vl (121.0 KB)

5 Likes

— Day 6: Guard Gallivant —

AOC_6A.vl (68.1 KB)
AOC_6B.vl (88.1 KB)

5 Likes

— Day 7: Bridge Repair —

AOC_7A.vl (86.6 KB)
AOC_7B.vl (88.2 KB)

4 Likes

— Day 8: Resonant Collinearity —

AOC_8A.vl (68.7 KB)
AOC_8B.vl (76.0 KB)

4 Likes

— Day 9: Disk Fragmenter —

AOC_9A.vl (92.2 KB)
AOC_9B.vl (136.6 KB)

4 Likes

— Day 10: Hoof It —

AOC_11A.vl (52.2 KB)
AOC_11B.vl (75.7 KB)

3 Likes

— Day 11: Plutonian Pebbles —

Probably the second one is unsolvable, because there is no way to achieve the necessary performance in the most important calculation. Would be interesting to see your suggestions.

AOC_11A.vl (52.2 KB)
AOC_11B.vl (75.7 KB)

Python Solution

Not only does it work almost instantly, but it takes 15 lines.

5 Likes

It’s not unsolvable.
It requires more work, as VL is one of the many languages that don’t have language support for memoizing function calls. This feature comes from functional languages and isn’t a common language feature in other programming environments.

In .Net (and C# as well),you have to memoize your function calls yourself, which can easily be done with a mutable dictionary.

Not saying it’s trivial, but it’s also no rocket science to make it run in VL.
I would say the particular quest is a bit tailored for certain languages.
Plutonian Pebbles.vl (34.4 KB)
Plutonian Pebbles Count.vl (110.0 KB)

edit: aha. also the count seems to need to be a integer64:
Plutonian Pebbles Count.vl (110.2 KB)

btw: I love you two for doing all these patches! Super good stuff! Thank you!

right: You need to work with BigIntegers for the Pebble number and at least Integer64 for the count. I hope this is the correct result finally?
Plutonian Pebbles Count BigIntegers.vl (116.1 KB)

6 Likes

@gregsn nice stuff, thanks for participating!

but answer is not correct)))

for string 5688 62084 2 3248809 179 79 0 172169 answer is 220566831337810 for 75 steps

but left part seems fine

upd: found the problem and after fixing it works fine

3 Likes

I’m back! Sort of.

Due to some family changes (good ones) I had to take a break. Returning to this I’ve realised that the livestreaming isn’t going to work. From now on I might only get very fractured time during the day to work on this. I won’t be able to find a quiet room for a couple of hours to get it done in one go.

So I’ve stopped the livestreaming, but I still aim to complete AOC24! I will have to go a bit slower and do it in chunks. I’ll make recording and stich together videos of what I do.

I’ve now added solutions up to day 6!

Check it out on youtube here

7 Likes