Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sevenseacat/advent_of_code

My Elixir solutions to Advent of Code
https://github.com/sevenseacat/advent_of_code

advent-of-code adventofcode

Last synced: about 5 hours ago
JSON representation

My Elixir solutions to Advent of Code

Awesome Lists containing this project

README

        

# Advent of Code

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/sevenseacat/advent_of_code/elixir.yml?branch=main&style=flat-square)](https://github.com/sevenseacat/advent_of_code/actions/workflows/elixir.yml)

My Elixir solutions for [Advent of Code](https://adventofcode.com/) (all years).

457 stars


38 stars

44 stars

50 stars

46 stars

39 stars

40 stars

50 stars

50 stars

50 stars

50 stars

This repository is a work in progress - I haven't yet completed all puzzles, but I'm working on them!

Each yearly event has:

* Daily solutions in `lib/y/day.ex`
* Tests in `tests/y/day_test.exs`
* Benchmarking in `lib/y/README.md`
* Doctests where applicable

Each day's solution follows a general formula:

* A module named after the day, eg. `Y2021.Day19`
* Reading any provided input file with `input/0` (sometimes not used)
* Parsing the input file into a useful structure with `parse_input/1`
* Piping the parsed input into a `part1/1` or `part2/1` function
* Optionally processing the result, eg. if `part1/1` returns a map with extra data but the question only needs a single key value.
* The test module for each day's solution verifies that the code gives the correct answer as input on the site, by calling `part1_verify/0` or `part2_verify/0`.

For the puzzles I completed prior to Advent of Code 2021, I've copied them from their original codebases into this repo commit by commit, modifying them to fit into my new universal structure. I've also kept the original author dates on those commits, some of them date back to 2016!