mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2024-10-31 23:54:11 +01:00
Advent Of Code
_templates/riddle/new | ||
.vscode | ||
2019 | ||
2020 | ||
2021 | ||
2022 | ||
.gitignore | ||
.nvmrc | ||
bun.lockb | ||
Cargo.lock | ||
Cargo.toml | ||
package.json | ||
poetry.lock | ||
pyproject.toml | ||
README.md | ||
rust-toolchain.toml | ||
tsconfig.json |
Advent Of Code
Template repository for Advent of Code. It automatically downloads your puzzle inputs and bootstraps files for the following languages:
- Typescript
- Python
- Rust
Have fun! 🤗🎄
Getting started
New "days" are generated with hygen
. This will bootstrap code for python and rust. See details about the specifica languages below
# First time setup
bun i
# Put the Advent of Code token into .env
# Generate day
bun run gen --year 2022 --day 1
Languages
Below are instructions for the specific handling of each language included.
Typescript
Run a single day:
# Once
bun run 2022/01/typescript/main.ts
# Rerun on change
bun run --watch 2022/01/typescript/main.ts
Python
# Get a python enabled shell, with the latest version
poetry shell
# Run once
python 2022/01/python/main.py
# Rerun on change
bunx nodemon 2022/01/python/main.py
Rust
Run a single day:
# Once
cargo run --bin 2022-01
# Rerun on change (requires: https://github.com/watchexec/cargo-watch)
cargo watch -x 'run --bin 2022-01'
Benchmark a day:
cargo bench --bin 2022-01
Benchmark all days:
cargo bench
The benchmark is the built in Rust one. This is the reason for the nightly version.