Skip to content

Latest commit

 

History

History
115 lines (92 loc) · 13.1 KB

README.md

File metadata and controls

115 lines (92 loc) · 13.1 KB

Advent of Code in Gleam

Solutions to Advent of Code in Gleam (36⭐):

Day 2017 2018 2019 2020 2021 2022 2023 2024
1 ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐ ⭐⭐
2 ⭐⭐ ⭐⭐ ⭐⭐
3 ⭐⭐ ⭐⭐
4 ⭐⭐
5
6 ⭐⭐
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Day 2015 2016
1 ⭐⭐ ⭐⭐
2 ⭐⭐
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Running the Solutions

We use the great gladvent project to run the AoC Gleam solutions

$ gleam run run 1 --year=2015

You can also run on example input:

$ gleam run run 1 --year=2015 --example

Bootstrap a Puzzle Solution

Use gladvent to invoke the Gleam template and set up files for a new solution:

$ gleam run new 1 --year=2015

Add input and example input files inside the relevant input subdirectory

Test a solution

You can run tests with gleam test:

$ gleam test

Additionally, gladvent uses expectations registered in gleam.toml to check that each solution gives the correct answer.

Adding a Solution to GitHub

Follow these steps after solving a puzzle:

  1. Store the expected results in the gleam.toml project file.

  2. Add a snapshot test with title "Puzzle 2015-01" (with appropriate numbers), run it, and accept it:

    $ gleam test
    $ gleam run -m birdie
  3. Update READMEs across all projects:

    $ cd ..
    $ make