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)
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
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
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
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..
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
Was really straight forward, the second one was clearly obvious, had already a solution by doing the first one.
This one was quite complicated, didn't manage to think of how to do it in Haskell. Had to do it in python sadly
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
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
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.
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
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.
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
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
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
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.
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
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.
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
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
Quite happy with my solution managed to do it quite fast and the problem solving was quite straight forward
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.
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.
This day was a maze solving algo, it was quite interesting to solve, the part 2 however was barely reuse of part 1...
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