Advent of Code problems solved in OCaml using the Jane Street Core alternative standard library
Solutions may be inefficient, anti-idiomatic, hot-garbage, etc. refer to them at your own risk.
- opam
- Linux / WSL
-
Clone the repo
-
Switch to the new directory
-
Create a new switch
opam switch create advent_of_ocaml 5.1.0
-
Update your PATH
eval $(opam env)
-
Install the project dependencies
opam install . --locked
-
Export your Advent of Code session ID (the
session
cookie when signed into adventofcode.com) to fetch your inputAlternatively, manually add an
input.txt
file tobin/solutions/<year>/<day>/
export AOC_SESSION_ID="<session ID>"
-
Make the runner script executable
chmod +x ./run.sh
-
Run a solution
./run.sh <year> <day>