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#
- Open the corresponding day file in
src/days/dayXX.gleam - Implement
part1andpart2functions - Add your puzzle input to
inputs/dayXX.txt - Add tests in
test/aoc2025_gleam_test.gleam