Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cupcakearmy/advent-of-code
Advent Of Code
https://github.com/cupcakearmy/advent-of-code
advent-of-code adventofcode solutions
Last synced: 7 days ago
JSON representation
Advent Of Code
- Host: GitHub
- URL: https://github.com/cupcakearmy/advent-of-code
- Owner: cupcakearmy
- Created: 2020-12-02T12:06:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-04T20:08:48.000Z (11 months ago)
- Last Synced: 2024-10-16T08:41:20.551Z (22 days ago)
- Topics: advent-of-code, adventofcode, solutions
- Language: Python
- Homepage: https://adventofcode.com/
- Size: 125 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent Of Code
Template repository for Advent of Code. It automatically downloads your puzzle inputs and bootstraps files for the following languages:
- Typescript
- Python
- RustHave fun! 🤗🎄
## Getting started
New "days" are generated with [`hygen`](https://github.com/jondot/hygen). This will bootstrap code for python and rust. See details about the specifica languages below
```bash
# First time setup
bun i# Put the Advent of Code token into .env (details below)
# Generate day
bun run gen --year 2022 --day 1
```> Extracting the Advent of Code cookie
>
> 1. Navigate to https://adventofcode.com/ and login.
> 2. Open dev tools and copy the cookie named `session`.
> 3. save `TOKEN=` to `.env`.## Languages
Below are instructions for the specific handling of each language included.
### Typescript
Run a single day:
```bash
# Once
bun run 2022/01/typescript/main.ts# Rerun on change
bun run --watch 2022/01/typescript/main.ts
```### Python
```bash
# 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:
```bash
# 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:
```bash
cargo bench --bin 2022-01
```Benchmark all days:
```bash
cargo bench
```> The benchmark is the built in Rust one. This is the [reason](https://doc.rust-lang.org/cargo/commands/cargo-bench.html) for the _nightly_ version.