These are my solutions for Advent Of Code 2023. My plan is to solve every puzzle with a different programming language, in alphabetical order. I make use of ChatGPT to help me with the programming language, however, I will not use it directly to help me solve the problem. In addition, I make use of the Replit AI code completion with the same intention.
Puzzle | Programming Language | Status | Replit | ChatGPT | Experience |
---|---|---|---|---|---|
1 | C | ⭐⭐ | Replit | ChatGPT | String manipulations with C are awful. It took me ages to just get a substring from a string and I most likely introduced a memory leak ;-) |
2 | C++ | ⭐⭐ | Replit | - | Much better than C due to standard library functions |
3 | C# | ⭐⭐ | Replit | ChatGPT | I feel nearly at home, because it is like Java ;-). My solution could have been more elegant, but I solved this one much faster than the other two. |
4 | Clojure | ⭐⭐ | Replit | ChatGPT | Took me ages to deal with a cryptic EOF error and syntax is hard to read for my eyes, but otherwise it was quite fun to think in a functional style. This puzzle took me longer than any other one so-far, but the solution is the most elegant one ;-) |
5 | Dart | ⭐⭐ | Replit | ChatGPT | Dart feels a lot like Java, not sure why Dart exists at all, but maybe I had not really hit the interesting features of the language with the puzzle, like the concurrency model. I had no real issues with the language. My Replit ran out of AI credits ;-) |
6 | Elixir | ⭐⭐ | Replit | ChatGPT | Beeing a purely functional language without loops I struggled a bit until I was able to create an iteration that stops at some point. Elixir has also a quite special syntax in some cases. |
7 | Erlang | ⭐⭐ | Replit | ChatGPT | Erlang was the hardest language for me so far. I struggled with the syntax, with the error messages, even with just printing strings to the console. I even had to read the documentation, because ChatGPT could not help me enough. Erlang is very different to common languages, just to name a few things: Variables have to be written with an upper case letter, counting starts at 1 and not at 0, you end functions with a dot. It feels like the language was developed by a person that wanted to do everything different. No wonder Elixir exists :-). |
8 | F# | ⭐⭐ | Replit | ChatGPT | F# itself is a quite nice functional language. Sometimes I struggled a bit with the syntax, but overall the language was not a big problem. What was more annoying was the second part of the puzzle itself, which was quite difficult to solve if you did not come up with the right idea. This puzzle took me way too much time to solve. |
9 | Go | ⭐⭐ | Replit | ChatGPT | Wow, Go has no map function? Seriously? Even ChatGPT was surprised :-). After all the functional languages before, I now needed to program imperatively again :-(. And the puzzle was suprisingly simple compared to the previous one, so that I was much faster done than in any other puzzle before. I was even sligthly disappointed that there was no big surprise in part 2 of the puzzle ;-) |
10 | Haskell | ⭐⭐ | Replit | ChatGPT | Haskell, the mother of all functional languages, is certainly one of the most interesting languages that exist, but also quite hard to learn. As I was already familiar with Haskell, it was not so difficult for me to use the language. I struggled more with the puzzle itself. Especially the second part was very hard if you don´t come up with the right idea. It took me way too long to solve and I needed help from ChatGPT to get to the idea. The resulting solution in Haskell is also very slow and takes over 10 minutes to finish. I am not sure why it is so slow, I assume the free Replit that I used, just has not enough RAM for Haskell. There is certainly also a more elegant solution than mine. |
11 | Java | ⭐⭐ | Replit | ChatGPT | Nothing special to say from my side, as Java is the language I know best. However, Java is not the most elegant language for these kind of programming tasks. |
12 | JavaScript | ⭐⭐ | Replit | ChatGPT | I program a lot in Javascript, so the language was no problem. However, the second part of the puzzle was the most difficult one for me so far. It took me three different attempts and three nights to sleep over until I finally got a solution that was performant enough. |
13 | Kotlin | ⭐⭐ | Replit | ChatGPT | I always wanted to try out Kotlin, but never did so far. As a Java developer it was a very pleasant experience, better than the Java experience :-). The Replit compiler was quite slow and it took about one minute for each run, which was annoying. |
14 | Lua | ⭐⭐ | Replit | ChatGPT | Lua is a very minimalistic language, so it lacked some library functions that are typically available in other languages and it counts from 1 instead of 0. Otherwise it was quite easy to learn |
15 | OCaml | ⭐⭐ | Replit | ChatGPT | OCaml is another language that I always wanted to try out. It is a nice functional programming language with a really powerful type system. I liked it. It is quite similar to F#. |
16 | Perl | ⭐⭐ | Replit | ChatGPT | Sure, using Perl is easier than using sed and awk, but still Perl is hard if you are not familiar with it. Thankfully, the puzzle itself was not so hard and I am done with this one :-) |
17 | PHP | ⭐⭐ | Replit | ChatGPT | I don´t know when I programmed the last time in PHP, I guess this is was over 20 years ago. I have forgotten that everything in PHP is an associative array :-). And also that this array is copied by value and not reference by default. This fact resulted in some debugging time. However, otherwise PHP is pretty simple. The puzzle, however, was quite hard. |
18 | Python | ⭐⭐ | Replit | ChatGPT | What should I say about Python that had not been said yet? It is a nice dynamically typed language, especially when working with lists. |
19 | R | ⭐⭐ | Replit | ChatGPT | R is a very special language, optimized for statistical computing and actually requires a different way of thinking, so I am quite sure that there is a much more concise solution than mine. But otherwise it was not too difficult. |
20 | Ruby | ⭐⭐ | Replit | ChatGPT | Ruby is a nice object-oriented, dynamically-typed language that I really like. Part 2 of the puzzle was hard. I did not came up with a general solution and had to hand-craft it for the input. |
21 | Rust | ⭐⭐ | Replit | ChatGPT | I feared the day when I needed to use Rust. I used Rust in the last years Advent of Code and I struggled a lot. In particular when you have to use cyclic data structures. Luckily in this puzzle this is not required. Rust is still the most difficult language of all languages that I used so far. The combination of ownership types and reference vs. non-reference types and special types for different integers (i64, usize) that needs conversion makes it really hard to convince the compiler. While the solution for the puzzle did not require cyclic data structures it was the hardest of all puzzles this year, at least for me. |
22 | Scala | ⭐⭐ | Replit | ChatGPT | Scala is a nice multi-paradigm language with a powerful type-system. I knew Scala already, so the language was no problem for me. The Puzzle was also quite straightforward and fun. |
23 | Swift | ⭐⭐ | Replit | ChatGPT | Swift was the biggest surprise for me so far. I never used it and expected something completely different. However, the language has quite a number of interesting and useful novel concepts, which makes it a solid modern language. The puzzle was also one of my favorites so far, not too easy, but not too difficult either. |
24 | TypeScript | ⭐⭐ | Replit | ChatGPT | Typescript is the language that I used the most lately so I am quite familiar with it. As it is basically Javascript, the code is not much different to plain Javascript code, except for some type annotations. The puzzle, especially Part 2, however, was ridiculously hard. I tried over 7 different implementations. And even the final one now requires the use of math.js to solve a set of equations. I would really love to know what the easiest solution to this puzzle is. This was the only time I made use of a library for solving a puzzle. In addition to that, I also ran into precision problems, which was difficult to fix in Javascript due to its limited number type. All-in-all this was a frustrating experience. |
25 | VisualBasic | ⭐⭐ | Replit | ChatGPT | Although VisualBasic is certainly one of the most used programming languages on the planet due to its integration into Excel, I never really programmed in it. Although I needed to get used to the syntax, it was not too difficult to grasp the language. The puzzle was quite hard though and I needed four different attempts until I got a working solution. |