Advent of Code 2025 solutions in Gleam
Gleam 100.0%
8 1 0

Clone this repository

https://tangled.org/adamwyluda.com/aoc2025-gleam
git@tangled.org:adamwyluda.com/aoc2025-gleam

For self-hosted knots, clone URLs may differ based on your setup.

README.md

Advent of Code 2025 - Gleam#

Solutions for Advent of Code 2025 written in Gleam.

Project Structure#

aoc2025-gleam/
├── src/
│   ├── aoc2025_gleam.gleam  # Main entry point
│   └── days/                 # Individual day solutions
│       ├── day01.gleam
│       ├── day02.gleam
│       └── ... (day01-day25)
├── inputs/                   # Puzzle inputs
│   ├── day01.txt
│   ├── day02.txt
│   └── ... (day01-day25)
└── test/
    └── aoc2025_gleam_test.gleam

Usage#

Each day has its own module in src/days/ with the following structure:

pub fn part1(input: String) -> String {
  // Solution for part 1
}

pub fn part2(input: String) -> String {
  // Solution for part 2
}

pub fn solve(input: String) -> Nil {
  // Prints both parts
}

Running Solutions#

To run a specific day's solution, use the run_day function from the main module:

import aoc2025_gleam
import simplifile

pub fn main() {
  let assert Ok(input) = simplifile.read("inputs/day01.txt")
  aoc2025_gleam.run_day(1, input)
}

Development#

gleam build  # Build the project
gleam test   # Run the tests
gleam run    # Run the main module

Adding Solutions#

  1. Open the corresponding day file in src/days/dayXX.gleam
  2. Implement part1 and part2 functions
  3. Add your puzzle input to inputs/dayXX.txt
  4. Add tests in test/aoc2025_gleam_test.gleam