OCaml solutions to as much of the 2023 Advent of Code as I can solve
  • OCaml 88.6%
  • C# 9.1%
  • Standard ML 1.8%
  • Dune 0.5%
Find a file
2023-12-21 14:35:55 +00:00
bin Solution for day 16 2023-12-21 14:35:55 +00:00
dotnet Solution to day 14 part 2 2023-12-20 22:01:13 +00:00
input Updated README to include instructions to run code 2023-11-25 18:02:40 +00:00
lib Solution for day 16 2023-12-21 14:35:55 +00:00
test Solution for day 16 2023-12-21 14:35:55 +00:00
.gitignore Slow, potentially working solution for day 12 2023-12-19 12:15:09 +00:00
aoc23.opam Added basic project structure 2023-11-25 17:54:38 +00:00
dune-project Added basic project structure 2023-11-25 17:54:38 +00:00
LICENSE Initial commit 2023-11-25 15:28:51 +00:00
README.md Updated readme for dotnet solutions 2023-12-20 22:10:38 +00:00

Advent of Code 2023

OCaml solutions to as much of the 2023 Advent of Code as I can solve.

Setup

This year's advent of code will be attempted in OCaml.

Rather than each day having its own directory with an executable script, I'm going to attempt to split my solution into bin, src, and test directories.

I'm using Visual Studio Code as my IDE with the OCaml Platform plugin.

When I'm stuck I've fallen back on C#.

Software versions

$ ocaml --version
The OCaml toplevel, version 5.1.0

$ dune --version
3.11.1

$ opam --version
2.1.5

$ dotnet --version
8.0.100

Building

$ dune build

Running unit tests

$ dune test

Running solutions

I've not included the input files this year, as I think there may some copyright issues around that.

To run the solutions you'll need to download and save your input files into the input directory.

Naming convention is day01.txt, day02.txt, etc.

OCaml

# to run most recent day
$ dune exec aoc23

# to run a specific day(s)
$ dune exec aoc23 1 2 3

# to run all days
$ dune exec aoc23 all

C#

For the days where I've got stuck with OCaml, each individual day's dotnet project can be built and run.

cd dotnet/DayTwelve
dotnet restore
dotnet build
dotnet run