I've recently fallen hopelessly enamoured with Prolog, a (mostly) declarative logic programming language, and attempting to solve https://adventofcode.com/2019 puzzles using solely the language, to see where this would lead us.
Some puzzles can be phrased conveniently as a search in a permutation space (see a_04a.prolog) and thus would be a perfect fit for Prolog. On the other hand, there are problems that boil down to emulating a Turing machine (see a_05b.prolog), which proved to be a bit frustrating. The hope is that AoC problems are diverse enough for patterns to emerge and for me to learn how to deal with different situations in Prolog.
Keep in mind that this is rather personal and that I'm still quite an inexperienced Prologer. If you want to follow along,
I'm using SWI-Prolog version 8.1.13 for x86_64-darwin
. Hopefully each Prolog file is self-contained and has its own
instructions on how to reproduce...
- https://github.com/kristianhasselknippe/advent-of-code-2019
- https://github.com/slavfox/advent-of-code-2019
- https://github.com/lemonad/advent-of-code/blob/master/2019-misc/december4.pl (almost exactly the same solution as mine!)
- https://github.com/gamache/advent2019
- Advent of Code Day 5 Pt. 1 in Prolog (2018) https://www.youtube.com/watch?v=utuHH_NuF_E
- Advent of Code Day 5 Pt. 2 in Prolog (2018) https://www.youtube.com/watch?v=u17Kmfnt64U
- https://github.com/jcazevedo/advent-of-code-2018/tree/master/day02-prolog
- https://github.com/lemonad/advent-of-code/tree/master/2018%20(Prolog)
- https://github.com/samwalrus/prolog_advent_of_code
- https://github.com/Average-user/adventofcode-pl-2017
- https://github.com/sindrekjr/AdventOfCode2017/blob/master/12/solution.pl