https://github.com/daniel5151/aoc21
My solutions to Advent of Code 2021 (in Rust)
https://github.com/daniel5151/aoc21
Last synced: about 1 year ago
JSON representation
My solutions to Advent of Code 2021 (in Rust)
- Host: GitHub
- URL: https://github.com/daniel5151/aoc21
- Owner: daniel5151
- Created: 2021-12-01T06:43:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-08T04:10:50.000Z (over 4 years ago)
- Last Synced: 2025-02-17T07:32:36.199Z (over 1 year ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of Code 2021
My solutions to Advent of Code 2021.
- Last year:
Goals for 2021:
- Solve the questions (duh)
- Each day should have two commits:
- The "quick and dirty" commit (rightanswer% speedrun)
- The "idiomatic Rust" commit (nice error handling, fancy iterators, etc...)
- Solutions should have _reasonable_ (i.e: not strictly the _best_) space and time complexity
- Solutions should terminate reasonably quickly
Some non-goals:
- Scoring super high on the leaderboard
- Not that I won't _try_ to land somewhere on the leaderboard 😉
- Only have until Dec 11th. I'm on east-coast time after that, and midnight coding != fast coding
## Running
(Assuming you've put the desired day's input into the `inputs` dir, either manually, or via `run.sh`)
```bash
cargo run --release --features extras --
```
Tests can be run using the standard `cargo test` flow.
```bash
cargo test -- dayX # only runs tests for the particular day
```
## Running (on the day of)
Manually copying question input? Nahhhh, we can do better than that.
When tests are passing and you're ready for prime-time, skip `cargo` and use the `run.sh` script:
```bash
./run.sh
# e.g: ./run 3 1
```
The harness will automatically download question input if a `cookie.txt` is provided.
`cookie.txt`'s should contain the following string:
```
session=53616c...
```
Getting `cookie.txt` is easy:
- Open Chrome
- Navigate to _any_ day's input URL (e.g: https://adventofcode.com/2021/day/1/input)
- Open the Chrome Network Inspector
- Refresh the URL
- Right click the `input` request, and "copy > copy as cURL"
- the string should include a `-H 'cookie: '` component.