/Advent2022

Advent Of Code 2022

Primary LanguageHaskell

New year, same me

Watch me code in Haskell for 25 days straight

Day Part 1 Part 2 Day Part 1 Part 2 Day Part 1 Part 2
Day 01 Day 10 Day 19
Day 02 Day 11 Day 20
Day 03 Day 12 Day 21
Day 04 Day 13 Day 22
Day 05 Day 14 Day 23
Day 06 Day 15 Day 24
Day 07 Day 16 Day 25
Day 08 Day 17
Day 09 Day 18

Personnal Feedback

Nothing quite remarkable, I wasn't going to use splitOn at first but I decided it was cleaner to use it (I am not sure it is standard though.)

Because this is really simple to solve, I tried to do it in the most cumbersome and compact way possible. Basically, the idea is to put everything in a matrix and notice that there is a cycle to the possible scores.

Weirdly enough, I really liked this one. I am quite proud of my solution :D

It is way too early for me to be awake, my solution is quite silly but it works.

The hardest part about this one was the parsing, and even that wasn't too hard

Easiest one.

This one was a bit harder, but once the parsing is done then it's not that hard. Is it weird that part 2 was easier than part 1 for me ? Anyway, tree traversals go brrrrrr (although I'd hoped to make my code clean which isn't the case right now :,()

Ah yes, my favorite time of the year: manipulating 2D grids in Haskell (/s) Well, it didn't go so bad, I definitely feel like I'm getting better at this every year!

I spent so much time on this simply because I didn't understand properly how moving works

Definitely one of the easiest ones so far (not as easy as Day 6, but still really easy)! I'm pretty sure that, had I woken up before 6AM today, I could actually have been in the leaderboard 🙀

Definitely one of the hardest to implement in Haskell so far. Proud to be a maths enthusiast

Probably my cleanest BFS in Haskell

This. This is the day I can proudly say "I know a bit of Haskell".

Highly unoptimised solution goes brrrr (part 2 takes like 1 second to run :ono)

And there I was, thinking my day 14 was unoptimised. 15 seconds to run part 2, but I'm taking it

Memoisation goes brrrrrrr (help me, I'm losing my mind, this one was way harder than any other day before)

Ok, this one was both really enjoyable but also somewhat frustrating. I felt I had to take a huge guess to see that the way to pile blocks was periodic.

At first I was scared because 3D geometry has never been my strong suit, but it turns out this one was a breather!

That's like day 16 but worse, my runtime is about 1 minute and a half, there might be some simple ways to make it faster but I can't be bothered with that

This one was easy, but I could do better (right now I have a runtime of 1 minute, which is not really fancy for such a simple problem), I might come back to it later

Another easy one, my solution is not the most optimised but it works well enough (and fast enough, 0.03s!)

Part 1 is really easy and enjoyable. Now about part 2: remember when I said I hated 3D geometry? That should tell you how much I enjoyed it. In the end my solution for part 2 was just hardcoding the wrapping transitions, which works for my input but not the example (different cube net shapes). It is possible that every input has the same cube net shape, in which case my solution will work on any input, just not on the example.

Probably one of the easiest part 2 ever, I only added a single line of code lol.

Nothing too hard, just a bunch of BFS

Wow, it's over... It kind of feels weird, this is my first time finishing the advent of code 🥹