Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcinruszkiewicz/advent_of_code_2024
Elixir solutions for 2024 Advent of Code
https://github.com/marcinruszkiewicz/advent_of_code_2024
advent-of-code adventofcode elixir
Last synced: 11 days ago
JSON representation
Elixir solutions for 2024 Advent of Code
- Host: GitHub
- URL: https://github.com/marcinruszkiewicz/advent_of_code_2024
- Owner: marcinruszkiewicz
- Created: 2024-12-01T19:37:52.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T20:53:33.000Z (2 months ago)
- Last Synced: 2024-12-08T21:35:06.492Z (2 months ago)
- Topics: advent-of-code, adventofcode, elixir
- Language: Elixir
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AdventOfCode2024
Elixir solutions for the [2024 Advent of Code](https://adventofcode.com/2024) puzzles.
## Importing puzzle data
Puzzle data is generated on the AoC website. You need to grab your session cookie and put it into a `config/secrets.exs` file, after that you can run `mix input 1 2024` to get the inputs for day 1 of AoC 2024.
- `priv` directory - put your puzzle data here with proper name (`day_200.txt` etc)
## Solving a puzzle
- `test/examples` directory - put your example data here with a proper name (`day200.txt` etc)
- create an `AdventOfCode.Day200` module in `lib/advent_of_code/day_200.ex`. Needs to have a `part1` and an `part2` public methods, so that you can use the mix tasks to run them, otherwise it can use whatever you like.
- create a `tests/day200_test.exs` so that you can run tests:```assert Day200.part2("test/examples/day200.txt") == 12345```
## Running the puzzle solvers
Use the mix tasks. They both take the module name as an argument:
- `mix part1 Day200` solves the part one of the given puzzle using the `part1` method
- `mix part2 Day200` solves the part two of the given puzzle using the `part2` method