WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

A collection of solutions for the Advent of Code, showcasing clean, efficient, and well-documented Elixir implementations for daily programming challenges.

License

Notifications You must be signed in to change notification settings

Elixir-journey/advent-of-code

Repository files navigation

Advent of Code Solutions

Build Status Elixir License

My solutions to Advent of Code challenges, implemented in Elixir.

Project Structure

lib/
├── year_YYYY/
│   └── day_N.ex        # Solutions for each day
├── infrastructure/     # Shared utilities
│   ├── common_helpers.ex
│   └── input_file_loader.ex
└── mix/tasks/          # Custom mix tasks
    ├── setup_day_challenge.ex
    └── run_day_challenge.ex

Getting Started

Development Setup

Auto-Formatting, Linting, and Error Reporting

This project includes a set of tools to ensure code quality and consistency. These tools are configured to run automatically on save, giving you immediate feedback as you work.

  1. Code formatting with Elixir Formatter

It ensures any code follows a consistent style. The Elixir Formatter is set to run automatically on save, formatting your code to follow standard Elixir conventions.

The .formatter.exs file controls settings, and auto-formatting is enabled in .vscode/settings.json.

  1. Linting with Credo

It enforces best practices and code consistency by highlighting potential readability and maintainability issues. Credo runs automatically on save through ElixirLS, displaying warnings and suggestions directly in the editor. You can also run mix credo in the terminal for a complete linting check.

  1. Type Checking and Error Reporting with Dialyzer

It analyzes code for type errors and potential bugs, offering an additional layer of safety. Dialyzer is integrated with ElixirLS, running in the background and reporting issues as you work. The initial setup may take a few minutes, as it builds a PLT (Persistent Lookup Table) with necessary type information.

Development with Dev Containers

Requirements:

  1. Open the project in VS Code
  2. Select "Reopen in Container" when prompted (or use Command Palette: Dev Containers: Reopen in Container)
  3. Dependencies install automatically via postCreateCommand

Running Locally (without Dev Containers)

Requires Elixir 1.19+ with OTP 28.

mix deps.get

Usage

Scaffold a new AoC day

mix setup_day_challenge 2025 1

Creates lib/year_2025/day_1.ex, test/year_2025/day_1_test.exs and lib/year_2025/inputs/day_1/input.txt.

Running an AoC day

mix run_day_challenge 2025 1

Running the mix task will run each part of the day (if available) otherwise, we can pass a part. The output will generate something like

Part 1: 1011
  Time: 2.52 ms

Part 2: 5937
  Time: 610.0 µs

License

See LICENSE for details.

About

A collection of solutions for the Advent of Code, showcasing clean, efficient, and well-documented Elixir implementations for daily programming challenges.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published