These are my solutions to 2019's famous Advent of Code. After hearing about 2019's intcode computer, having done Day 17 from 2024, I had to give this one a look.
Solutions make use of cargo-aoc code helper (here).
IntCode puzzles denoted with an asterisk.
All solutions linked below:
| Day | Title | 1 ⭐ | 2 ⭐ | Solution | Rating | |
|---|---|---|---|---|---|---|
| 01 | The Tyranny of the Rocket Equation | 210ns | 1.26µs | day01.rs | 😎 | |
| 02 | * | 1202 Program Alarm | 832ns | 513µs | day02.rs | 😆 |
| 03 | Crossed Wires | 89.0µs | 89.0µs | day03.rs | ||
| 04 | Secure Container | 3.92µs | 10.9µs | day04.rs | 😔 | |
| 05 | * | Sunny with a Chance of Asteroids | 4.07µs | 4.07µs | day05.rs | 😋 |
| 06 | Universal Orbit Map | 49.6µs | 30.5µs | day06.rs | 😦 | |
| 07 | * | Amplification Circuit | 86.9µs | 527µs | day07.rs | 😬 |
| 08 | Space Image Format | 280ns | 27.9µs | day08.rs | ||
| 09 | * | Sensor Boost | 11.4µs | 3.20ms | day09.rs | 😖 |
| 10 | Monitoring Station | 4.92ms | 5.10ms | day10.rs | 😱 | |
| 11 | * | Space Police | 1.19ms | 160µs | day11.rs | 😃 |
| 12 | The N-Body Problem | 728µs | 45.1ms | day12.rs | 😓 | |
| 13 | * | Care Package | 201µs | 5.98ms | day13.rs | 😂 |
| 14 | Space Stoichiometry | 45.7µs | 275µs | day14.rs | 😮 | |
| 15 | * | Oxygen System | 2.74ms | 2.58ms | day15.rs | 🤠 |
| 16 | Flawed Frequency Transmission | 329µs | 111ms | day16.rs | 🤯 | |
| 17 | * | Set and Forget | 377µs | 793µs | day17.rs | 😭 |
- I thought having an array as a parameter cache in the VM would speed things up, but apparently simply returning an array is consistently marginally faster.
- A simple typo on day 9 caused hours of searching.
- Sometimes day 10 part 2 runs faster than part 1, even though it is part 1 with extra steps. I had also expected part 2 to run much slower in general, but perhaps BTreeMap is just that efficient.
- Day 15 - AI in intcode!
- Day 16 was a particularly tricky one
- Day 17 has a rather annoying untraceable bug somewhere in the VM that causes the map to be slanted when address 0 is changed from '1' to '2'.
- Day 17 - As it turns out, there was nothing wrong with the VM after all; I just had a bug in the grid drawing function for that day, as the output included the first prompt, not just the map.