Advent of code (more than just 2022) in Fortran
The solution for each day is implemented in yyyy/d/main.f90
, where yyyy
is the year and d
is the day, e.g. 2022/1, 2022/2, 2022/3, ...
To compile and run an implementation:
cd 2022/1
../../build.sh
./main
The solution is printed to the console.
- A Fortran compiler, preferably
gfortran
orifort
. Configure the compiler inbuild.sh
.
My difficulty ratings are obviously subjective. What's hard for me might be easy for others. Also, there is a path-dependence to the difficulty. For example, I thought 2022 day 7 was particularly hard compared to days 1-6, mostly because I had never implemented a general tree data structure in Fortran. After that, I used trees in several other days (e.g. day 13). Since I already had trees in my toolbelt, I didn't feel like that was as difficult anymore.
Much of AOC 2019 is centered on Intcode, an assembly-like language for which we are tasked with writing an interpreter.
Day | Description | Difficulty |
---|---|---|
2 | Intcode: add, multiply, and finish | 😀 |
5 | Intcode: I/O, parameter modes, jumps, and comparisons | 😀 |
7 | Intcode: piping I/O between programs, pausing and continuing interpretation while awaiting input | 😅😅 |
9 | Intcode: relative mode, 64 bit, memory buffer | 😀 |
11 | Interfacing with Langton's ant in Intcode | 😀 |
13 | Interfacing with Breakout in Intcode. Watch the video | 😅😅 |
15 | Interfacing with Intcode while performing a breadth-first search | 😅😅 |
Day | Description | Difficulty |
---|---|---|
1 | Summing integers | 😀 |
2 | Playing rock paper scissors | 😀 |
3 | Finding common characters in multiple strings | 😀 |
4 | Comparing integer ranges | 😀 |
5 | Rearranging data in a rank-2 array | 😅😅 |
6 | Searching for substrings that contain a unique set of characters | 😀 |
7 | Reconstructing a filesystem by parsing shell commands and their output | 🥵🥵🥵 |
8 | Comparing integers in a rank-2 array | 😅😅 |
9 | Implementing snake game kinematics | 😅😅 |
10 | Drawing pixels on a simple screen | 😀 |
11 | Performing bignum arithmetic, or is it 😉 | 😅😅 |
12 | Finding the shortest path | 😅😅 |
13 | Parsing and comparing arbitrarily-nested JSON arrays | 😅😅 |
14 | Detecting collisions in a pixel game | 😀 |
15 | Searching a large space with "beacons" and "sensors" | 😅😅 |
16 | Traversing paths in a graph and maximization | 💀💀💀💀 |
17 | Simulating a trillion tetris pieces | part 1 😅😅, part 2 💀💀💀💀 |
18 | Finding the surface area of a voxel mesh by flood filling | 😅😅 |
19 | Looks like another dynamic programming problem like day 16? Ion want nothing to do with that | |
20 | Permuting numbers in a circular list | 😅😅 |
21 | Evaluating arithmetic expressions and symbolic algebra | 😅😅 |
22 | Following a path with obstacles in 2D and projected 3D | 🥵🥵🥵 |
23 | Implementing cellular automata | 😅😅* couldn't crack part2, probably some dump typo |
24 | Finding the shortest path on a map with moving obstacles | 😅😅 |
25 | Arithmetic in base-5 signed-digit representation | 😀 |