Advent of Code 2024
Here are my solutions for Advent of Code 2024. I always start to (try to) solve the problems in Picat, and then other languages might be tested, for example Racket or ngn-k.
Utilities
Solutions
These files will also be available at my GitHub repo: github.com/hakank/hakank/tree/master/advent-of-code-2024 (after a while).
- Day 1: 1.pi (Picat), 1.rkt (Racket), 1.k (ngn-k)
- Day 2: 2.pi (Picat), 2.rkt (Racket), 2.k (ngn-k)
- Day 3: 3.pi (Picat, using my regex module), 3b.pi (Picat, a little neater version of part2), 3c.pi (Picat, better version of part 2, and another version of part 1)
- Day 4: 4.pi (Picat), 4.rkt (Racket)
- Day 5: 5.pi (Picat), 5_part2.pi (Picat, quite faster part 2 using topological sort) 5_part1.rkt (Racket, Part 1), (5_part2_rosette.rkt (Racket, Part 2, but unfortunately too slow))
- Day 6: 6_part1.pi (Picat, part 1) 6_part2.pi (Picat, part 2)
- Day 7: 7.pi (Picat)
- Day 8: 8.pi (Picat)
- Day 9: 9.pi (Picat)
- Day 10: 10.pi (Picat)
- Day 11: 11.pi (Picat, both part 1 and part 2) 11_part1.pi (Picat, brute force for part 1)
- Day 12: 12_part1.pi (Picat, part 1) 12_part1b.pi (Picat, part 1, shorter and faster than 12_part1.pi)
- Day 13: Picat: 13.pi (Picat) 13_nondet.pi (Picat, just for fun: solving part 1 with
between/3
non-deterministic predicate) 13_regex.pi (Picat, parsing with the regex module ) 13_dcg.pi (Picat, parsing with DCGs)
Racket: 13.rkt (Racket with Rosette Z3 solver) 13_matrix.rkt (Racket, using math/matrix-solve
)
- Day 14: 14.pi (Picat) 14b.pi (Picat, some faster versions and alternative pattern detection methods)
- Day 15: 15_part1.pi (Picat, only part 1)
- Day 16: 16_part1.pi (Picat, only part 1)
- Day 17: 17_part1.pi (Picat, only part 1)
- Day 18: 18.pi (Picat)
- Day 19: 19.pi (Picat)
- Day 20: -
- Day 21: 21.pi (Picat, only part 1)
- Day 22: 22.pi (Picat)
- Day 23: 23.pi (Picat)
- Day 24: 24_part1.pi (Picat, part 1) 24_part1b.pi (Picat, part 1, alternative approach)
- Day 25: 25.pi (Picat, only part 1 this day)
Back to my homepage
Created by Hakan Kjellerstrand hakank@gmail.com