This repo contains my solutions for the 2023 Advent of Code. I took this opportunity to learn a new language I've been wanting to try out for some time, Elixir, a widely used Brazilian functional programming language.
What you'll find in here is mostly comprised of DSA, text manipulation and some other shenanigans.
To run this project:
- Install Erlang/OTP 25 (direct link)
- Install Elixir (direct link)
- Clone this repo
- Run the
day
task
This command allows you to run the solution for the specific day and part, possibly using the provided filename as input.
If filename is absent, uses input.txt
Examples:
# Runs solution for Day 3 Part 2, using input.txt
mix day 3.2
# Runs solution for Day 4 Part 1, using test.txt
mix day 4.1 test
Generates the following boilerplate for solving day
:
advent_of_code/
├── (other solutions)
└── day_n/
├── part_1.ex
├── part_2.ex
├── input.txt
└── test.txt
Each solution part is also initialized with some boilerplate code:
alias AdventOfCode.Utils
defmodule AdventOfCode.Day$day_number$.Part$part_number$ do
def line_parser(line) do
line
end
def run(file_name) do
file_name
|> Utils.parse_file(&line_parser/1)
end
end
The $day_number$
and $part_number$
placeholders are replaced with the proper values during creation.