Skip to content

mychris/aoc-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2024

OCaml project with AoC 2024 solutions.

Developed with The OCaml toplevel, version 5.2.1.

Aoc2024.Day01.example ();;

let input = In_channel.with_open_text "path/to/input.txt" In_channel.input_all in
Aoc2024.Day01.run input;;

#show Aoc2024;;

Use dune to build/execute/fmt, or have a look at the Makefile:

  • dune build

  • dune exec aoc-2024

  • dune fmt

The executable can run the examples, or a single day as well:

Usage: aoc-2024 [-day <day>]... [-example]
  -day <day> Run <day>. Can be given multiple times
  -example Run the example instead of the input
  -help  Display this list of options
  --help  Display this list of options

The bin directory contains a small main file. It requires the inputs directory to be populated with the input files for each day, like inputs/day01.txt. See the main.ml file for all input files.

For each day one module is present in the lib directory, containing a run and an example function. run expects the input of the problem as a string and computes the results. To run the provided example, no input is required.

Dependencies

Links

License

Copyright (c) 2024 Christoph Göttschkes

Licensed under the MIT License. See the LICENSE file for more info.

About

Advent of Code 2024

Topics

Resources

License

Stars

Watchers

Forks

Languages