Skip to content

Latest commit

 

History

History

2022

Advent of code 2022

This year I will probably try to use Haskell or Lua
(as well as Bash, Python, Java, JS, C#, C if needed)

  • 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 (only part 1)
  • Day 17 (only part 1)
  • Day 18
  • Day 19
  • Day 20
  • Day 21
  • Day 22
  • Day 23
  • Day 24
  • Day 25 (only part 1)

Feedback

Day 1:

Was pretty easy to find a solution, did it first in shell, quite happy to have done it this fast. Did it in Haskell afterward, quite shorter and seems nice when you understand how to use it, $ is a nice feature

Day 2:

Was sick so was quite tiring to do it, and clearly took more time than I should have but still managed to do it. Perhaps not the nicest solution, will try to refactor it

Day 3:

Was still a bit sick but was ok, managed to do the solution, though I didn't want to download any packages for now so had to copy paste the functions form their source

Day 4:

Was quite easy, decided to download the package split anyway, just saving time quite happy about the solution, not to long. Though I might try to refactor a bit..

Day 5:

Was a bit tricky this one. I had a very good idea for an iterative language but didn't quite get one for Haskell at first so had to mess arround in order to find an idea

Day 6:

Was really straight forward, the second one was clearly obvious, had already a solution by doing the first one.

Day 7:

This one was quite complicated, didn't manage to think of how to do it in Haskell. Had to do it in python sadly

Day 8:

At first didn't quite get the good methodology, had to do it first in python in order to do it in haskell, realized half way through the python version what was my mistake. Otherwise I'm quite happy how the haskell code turned out, I used where, lambda functions and list creation

Day 9 :

This one was quite a mess but I'm quite happy with my solution. Had luck making it work at first but managed to fix it for any input and now it should work completly fine

Day 10 :

Was fun, the first part was very easy and the input I use is quite fun since I avoid most the information to only get a list of int without the name of the instructions so quite happy of the input analysis I did. Had a bit of difficulty trying to understand how the part 2 was working but managed to do it so that's ok.

Day 11 :

This one was a bit tricky, the input was way more difficult that usual and the thingy with the overflow was a bit hard to figure out (thx raph for the help). For this one managed to change my implementation to use data which makes the code way more readable

Day 12 :

This one was pathfinding, begun with a dfs but was really a bad idea so went on a bsf instead. Not quite proud of how part 2 ended, big copypaste with a small modification, will try to change it to a better one Today I also discovered that there was a debugger in Haskell, will have to look into it, for the moment seems really bad but need to try it.

Day 13 :

This one was not too hard. Had to think of a trick to have lists of possibly int or list but managed using '[' <=> -1 and ']' <=> -2. Finding the bugs were a bit tricky with those functions but some trace made the trick so it was ok

Day 14 :

Was fun, even managed to create a pretty print, though the solution is a bit long will try to refactor it. Managed to pretty print the map and to count according to the values and not to the number of iterations

Day 15 :

This one was quite tricky, tried to do it the dumb way at first (checking at each point if there was a sensor in range) and this took ages to run. Raph came in clutch and I saw the idea of using ranges of sight and merging them together so that's what I did and this solution is way faster to solve. quite happy the way it looks, took idea from raph but still managed to do my own code

Day 16 :

Didn't manage to fix my answer, even for part 1, I will definetly try to fix it since it only show a result close to the one we want but for the moment I will continue to next Day.

Day 17 :

For the moment managed to do a nice parsing and uite happy of how it turned out Now I need to make the rocks move like in a tetris game, and that's getting harder

edit : Compared to the last two, this one was quite nice the idea of tetris was a bit difficult to visualize the solution at first but then by decomposing every parts I managed to make it. Though for part 2 I still haven't found a way to shorten the process, I'll have to find a cycle, perhaps using memoisation

Day 18 :

For this one, the 3D geometric was a bit difficult to manage, I thought I had an idea but then realised it couldn't work so I had quite a lot of thinking to do. Thanksfully, I think well enough when I'm watching movies so it helped quite a lot.

Day 19 :

First shot at this one, managed to parse and have a "theoretically working" solution except it's exponential and won't be able to run fast enough, so now I have to limit the results and filter out wrong results

Day 20 :

The problem was to move elements in a list according to their value This fay was quite a mess but was solvable, at first I tried to move the values themselves, then I thought that it was way easier to move a list of index and then to recreate the final array, I'm quite happy of how it turned out

Day 21 :

Quite happy with my solution managed to do it quite fast and the problem solving was quite straight forward

Day 22 :

This day was quite easy to figure out a solution, the issue was to visualize the specific values to use for example the new coordinates when using the dice and the new directions.

Day 23 :

This day was really straight forward, I was doing part two instead of part one without even realizing, just a tiny error of 1 in part two annoyed me but that's all.

Day 24 :

This day was a maze solving algo, it was quite interesting to solve, the part 2 however was barely reuse of part 1...

Day 25 :

Last day, this one only had a part 1, the part 2 was just to complete all of the other days so only part one done. The exercise was to create a conversion between decimal and Snafu which is created using -2 -1 0 1 2, at first I created a brute force algo but was way too slow so I remembered how to actually convert numbers and the algo was quite easy to implement.

This also sets the end of a journey, the AOC 2022 is now over and the only thing left to do might be to finish before the next one

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy