Skip to content

Sheinxy/Advent2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent2021

Guess who's back, back again


Watch me code in Haskell for 25 days straight

  • Day 1
  • Day 2
  • Day 3
  • Day 4
  • Day 5
  • Day 6
  • Day 7
  • Day 8
  • Day 9
  • Day 10
  • Day 11
  • Day 12
  • Day 13
  • Day 14
  • Day 15
  • Day 16
  • Day 17
  • Day 18
  • Day 19
  • Day 20
  • Day 21
  • Day 22
  • Day 23
  • Day 24
  • Day 25

Personnal Feedback

Day 1:

I am quite proud of my solution, I'm obviously just trying to show off here but it's fun. When I look back at my first solution last year, I feel like I've progressed quite a lot!

Day 2:

This one was easy, I am kind of disappointed that I couldn't do showy one-liners for the move function (I mean, I could with inline if-else I guess)

Day 3:

Okay this one was kind of a mess, the first part is pretty okay (I probably could have done something more optimised, but it works just fine), however I am totally unsatisfied by my second part. I think there has to be a way in Haskell to do what I want

Day 4:

Well, it may not be the most optimised, like I have to traverse the grid twice because I'm too lazy to do things better, but it works, it's readable and all, so yeah I'm kind of satisfied, oddly enough

Day 5:

This one was easy and pretty straightforward, I'm happy with my solution. I just wish I could mix both parts into one but I can't

Day 6:

This one was really fun. Of course I first I did the most naive solution, but then when I went onto part 2 I had to do a smarter one. Of course mine is still not that smart, because I can't modify an element of a list in-place I just decided to do a silly workaround, but it works and it's fine considering the size of the array

Day 7:

Okay I am really disappointed in myself for that one. I feel like there's a much better way of doing part 2, but I can't find it for now. I'm going to think a little bit more about it. Edit: Ok I am more satisfied now

Day 8:

THIS ONE WAS INCREDIBLY FUN! I am actually quite happy with my solution. Although some would find it ugly and whatnot, I believe it is actually a good solution as it manages to be both simple to understand (basically the only weird thing to understand is the head . filter thingies, because I didn't want to use find because it didn't make sense to have Maybe here in my opinion)

Day 9:

I came prepared with Data.Matrix ;D. I was waiting to use that one, and here it is! Also, I think I did a fricking DFS using foldl, didn't I?

Day 10:

This one was really easy. Too easy in fact, it was kind of boring :C I mean, it's just matching parenthesis all over again in the end

Day 11:

I was really scared about cellular automaton in Haskell because I had a very bad experience last year. Turns out this year I am rolling over them quite easily, good innit?

Day 12:

This wasn't too bad. Kind of had to create my own Graph implementation but I managed to do it so that's good. Not much fan of how I named parameters and functions here but hey, what can you do about that.

Day 13:

This one was really easy. I don't have much to say, Data.Matrix is still a blessing <3

Day 14:

This is day 6 all over again, albeit much uglier ono

Day 15:

This is just a Dijsktra thingy. There probably was some way to optimise part 2, but I'm far too lazy for that :d

Day 16:

May god have mercy on my soul, as I have sinned. My solution is horrible and I want to sleep. Oh lord what have I done, this is a mess, please help me

Day 17:

I am really disappointed here, all I did was bruteforce my way in. I hope there actually is a clever solution. I think there might be, by solving some equations and whatnot, but I am tired.

Day 18:

Explanations were unclear, and doing that in Haskell was a hustle. But I managed. I survived