This repository has been merged with jcazevedo/advent-of-code-solutions.
Advent of Code 2018
This repository contains my solutions to Advent of Code 2018. After three years solving the problems exclusively in Scala, I decided to solve each day of 2018 in a different programming language.
Rules
Some "rules" I set up for myself before starting solving the problems:
- The languages to be used in each day are the following, in order: Idris, Prolog, Lua, Rust, C++, Ruby, Octave, Python, Erlang, R, OCaml, Dart, PHP, Elixir, Pony, Scala, Swift, Haskell, Go, Nim, Kotlin, TypeScript, Perl, Java and Clojure.
- The solutions should read the input from a predefined file (named
<day>.input
) and write the solution to the standard output. - The solutions should take less than a minute to output the correct answer on my machine.
- Dependencies should be limited to each language's standard library.
Problems
- Day 1: Chronal Calibration (Idris): problem statement / solution
- Day 2: Inventory Management System (Prolog): problem statement / solution
- Day 3: No Matter How You Slice It (Lua): problem statement / solution
- Day 4: Repose Record (Rust): problem statement / solution
- Day 5: Alchemical Reduction (C++): problem statement / solution
- Day 6: Chronal Coordinates (Ruby): problem statement / solution
- Day 7: The Sum of Its Parts (Octave): problem statement / solution
- Day 8: Memory Maneuver (Python): problem statement / solution
- Day 9: Marble Mania (Erlang): problem statement / solution
- Day 10: The Stars Align (R): problem statement / solution
- Day 11: Chronal Charge (OCaml): problem statement / solution
- Day 12: Subterranean Sustainability (Dart): problem statement / solution
- Day 13: Mine Cart Madness (PHP): problem statement / solution
- Day 14: Chocolate Charts (Elixir): problem statement / solution
- Day 15: Beverage Bandits (Pony): problem statement / solution
- Day 16: Chronal Classification (Scala): problem statement / solution
- Day 17: Reservoir Research (Swift): problem statement / solution
- Day 18: Settlers of The North Pole (Haskell): problem statement / solution
- Day 19: Go With The Flow (Go): problem statement / solution
- Day 20: A Regular Map (Nim): problem statement / solution
- Day 21: Chronal Conversion (Kotlin): problem statement / solution
- Day 22: Mode Maze (TypeScript): problem statement / solution
- Day 23: Experimental Emergency Teleportation (Perl): problem statement / solution
- Day 24: Immune System Simulator 20XX (Java): problem statement / solution
- Day 25: Four-Dimensional Adventure (Clojure): problem statement / solution
Running
You can run a solution by typing the following, replacing <X>
with the day of
the desired problem:
$ ./run.sh <X>
You might need to install some dependencies. It should be easy to guess which
ones by looking at the
run.sh
script.