For any other OCamlers having a go at Advent of Code this year, I thought I’d create this thread for discussing/sharing/comparing.
I doubt I’ll see it all the way through myself, but will keep at it until I run out of steam
If anyone would like to form an ocamlcentric leaderboard, all may feel free to use my private leaderboard, by entering code 221063-e41acad3 at Leaderboard - Advent of Code 2021 (after logging in). I’d also be happy to join a different leaderboard if there’s already one fit for this purpose
I’ve already fallen a bit behind, so I’m not sure how long I’ll keep at it either, but I’ll join! Here are my solutions so far.
For Day 3 I also decided to try to see how close I could get to the top 100, so I did my first solution in the browser console and got it in about 6 minutes, which got me about 1000th place I think, so I gave up on that idea
I had been referring to your old leaderboard, from your post in 2017, as a motivator, but decided to create this thread after I got booted from it I hope your Rusting in going swell!
Last year I tried to do the solutions in Lambda Prolog, with the aim of learning new things. I did learn a lot, but I also found that I am generally so slow at solving the puzzles that the added challenge of a new (research-grade) language made it impossible for me to keep up. The main thing I aim to learn this year is how to dispatch the puzzles more quickly! So my ambition is to solve the puzzles in little enough time that I can sustain engagement throughout the whole calendar. We’ll see how that goes
Congrats on making it into the top 1000th! Even if my bedtime weren’t well before midnight EST, I still don’t think I’d have a prayer of solving a puzzle quickly enough for that I’ve enjoyed looking over your solutions, thank you for sharing!
My solutions are going into GitHub - shonfeder/aoc2021: AOC 2021 in OCaml 🐫 . I’m currently trying to focus on improving my ability to focus and avoid getting lost down rabbit holes or caught up in trivial mistakes that slowdown my time to solution. To that end, I’ve started keeping some notes to reflect on the mistakes I’m making.
There are people doing speed runs who finished both parts of day 1 in under 90 seconds. I think one’s best policy, unless one is determined to set up specifically to do speed runs, is to accept that one is not going to be high on the leaderboard.
One of the learnings I’m hoping to glean from this year’s puzzles is to improve my ability to analyze, “formalize”, and implement specifications. So I’m spending some time each day refining the puzzle descriptions into more systematic specifications. Today I noticed an inconsistency in the puzzle description
The energy level of each octopus is a value between 0 and 9 .
…
any octopus with an energy level greater than 9flashes
If the first line holds, then no octopus could flash!
I’ve done a couple using Eio, the Eio.Path.with_lines function has been super useful. Might find some use for its built-in parser combinator too in coming days.