Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codemicro/adventofcode
Advent of Code solutions in a number of different languages
https://github.com/codemicro/adventofcode
advent-of-code adventofcode adventofcode2020 adventofcode2021 adventofcode2022 adventofcode2023
Last synced: 4 days ago
JSON representation
Advent of Code solutions in a number of different languages
- Host: GitHub
- URL: https://github.com/codemicro/adventofcode
- Owner: codemicro
- License: mit
- Created: 2020-12-01T23:16:14.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T18:38:28.000Z (about 1 month ago)
- Last Synced: 2025-01-12T11:50:21.991Z (10 days ago)
- Topics: advent-of-code, adventofcode, adventofcode2020, adventofcode2021, adventofcode2022, adventofcode2023
- Language: Python
- Homepage:
- Size: 19 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code 🎄
Jump to: [2020](challenges/2020) - [2021](challenges/2021) - [2022](challenges/2022) - [2023](challenges/2023) - [2024](challenges/2024)
Solutions to [Advent of Code](https://adventofcode.com) challenges.
Puzzle inputs and descriptions are not included in this repository. You'll have to get these yourself from the AoC website. [Here's why](https://www.reddit.com/r/adventofcode/comments/k99rod/sharing_input_data_were_we_requested_not_to/gf2ukkf/?context=3).
[AoC website](https://adventofcode.com) - [AoC subreddit](https://www.reddit.com/r/adventofcode) - [AoC awesome list](https://github.com/Bogdanp/awesome-advent-of-code)
## Running solutions
The method of running solutions varies by year.
From 2023 onwards
Use the `./aoc` script and provide it with the filename of the file you would like to run. For example, `./aoc run challenges/01-trebuchet/main.py`.
Alternatively, run the code directly. Provide it with an input via stdin and set the first command line argument to be either `1` or `2` to run either part 1 or 2 respectively. This should go for all languages.
2021 and 2022
In order to run solutions from 2021 and 2022, you should switch to the `2022` branch first.
Solutions to 2021's and 2022's solutions are run via the runner program contained in [`./runtime`](./runtime).
To run a solution, run `go run github.com/codemicro/adventOfCode/runtime` and follow the on-screen prompts. Configurisation options can be seen by running with the `--help` flag.
A benchmark graph can be generated using [`generate-benchmark-graph.py`](./generate-benchmark-graph.py) as follows: `python3 generate-benchmark-graph.py `.
For example, to generate a graph for the 2021 benchmarks and save it to `challenges/2021/running-times.png`, you can run `python3 generate-benchmark-graph.py challenges/2021/running-times.png 2021`.
2020
In 2020, all solutions are in Python and/or Go.
1. `cd` to the challenge directory
eg: `cd challenges/2020/05-binaryBoarding`
2. Run the desired implementation
* For Python, run `python3 ./py`
* For Go, run `go run ./go`Dependencies for 2020 challenges are not neatly defined anywhere, so determing and installing the correct ones is an exercise for the reader.