2023-03-13 23:55:38 +01:00
|
|
|
# Advent of Code 2019
|
|
|
|
Solutions to [Advent of Code 2019](https://adventofcode.com/2019) in Python 3.
|
|
|
|
|
|
|
|
## Usage
|
2023-03-14 00:00:43 +01:00
|
|
|
To solve all puzzles with implemented solutions run
|
2023-03-13 23:55:38 +01:00
|
|
|
```console
|
2023-03-14 01:01:43 +01:00
|
|
|
$ python3 main.py
|
2023-03-13 23:55:38 +01:00
|
|
|
```
|
2023-03-14 18:20:07 +01:00
|
|
|
For faster execution use `pypy3`
|
2023-03-13 23:55:38 +01:00
|
|
|
```console
|
2023-03-14 18:20:07 +01:00
|
|
|
$ pypy3 main.py
|
2023-03-13 23:55:38 +01:00
|
|
|
```
|
2023-03-14 18:20:07 +01:00
|
|
|
or make the main program executable.
|
2023-03-14 12:52:27 +01:00
|
|
|
```console
|
2023-03-14 18:20:07 +01:00
|
|
|
$ chmod +x main.py
|
|
|
|
$ ./main.py
|
2023-03-14 12:52:27 +01:00
|
|
|
```
|
2023-03-14 18:20:07 +01:00
|
|
|
To download your puzzle inputs (the inputs are different for each user),
|
|
|
|
run `./main.py --fetch-session` and input your session key.
|
|
|
|
The session key can be found by inspecting the headers of a HTTP request
|
|
|
|
made from a browser on which the user is logged in. The HTTP request header
|
|
|
|
in question has the following format : `Cookie : session=key`.
|
|
|
|
|
2023-03-14 12:52:27 +01:00
|
|
|
For other options see `./main.py -h`.
|
2023-03-13 23:55:38 +01:00
|
|
|
```console
|
2023-03-14 01:01:43 +01:00
|
|
|
$ ./main.py -h
|
2023-03-13 23:55:38 +01:00
|
|
|
usage: main.py [-h] [-d DAY[-DAY]] [-i INPUT] [-t]
|
|
|
|
|
|
|
|
Solves Advent of Code 2019 puzzles. The puzzles are available at
|
|
|
|
https://adventofcode.com/2019/
|
|
|
|
|
|
|
|
optional arguments:
|
|
|
|
-h, --help show this help message and exit
|
|
|
|
-d DAY[-DAY], --day DAY[-DAY]
|
|
|
|
solve puzzle of day DAY or of range DAY-DAY
|
|
|
|
-i INPUT, --input INPUT
|
|
|
|
use INPUT as puzzle input
|
|
|
|
-t, --test run tests
|
|
|
|
```
|