README and misc
This commit is contained in:
parent
cad67794c3
commit
fdeb6e3b64
|
@ -0,0 +1 @@
|
|||
gettoday merge=ours
|
|
@ -0,0 +1,8 @@
|
|||
*.sw?
|
||||
aids
|
||||
__pycache__/
|
||||
tmp
|
||||
a.out
|
||||
response*
|
||||
*.hi
|
||||
*.o
|
|
@ -0,0 +1,25 @@
|
|||
# Advent of Code 2021 solutions
|
||||
|
||||
A set of 25 puzzle inputs and 50 puzzle solutions, two for each day. Most can
|
||||
be solved in minutes. The puzzles can be found
|
||||
[here](https://adventofcode.com/2021/), although only the first one for each
|
||||
day is visible until you solve it.
|
||||
|
||||
Most solutions output at most two lines, the answers to part 1 and 2; but some
|
||||
provide more information in the form of e.g. graphics.
|
||||
|
||||
Run a solution by passing the puzzle input to the program:
|
||||
|
||||
```./one_first.awk <input1```
|
||||
|
||||
or
|
||||
|
||||
```./five.py -v <input5```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
cd six
|
||||
lein run <../input6
|
||||
lein run 256 <../input6
|
||||
```
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
year=2021
|
||||
day="$(date +%d | sed 's/^0//')"
|
||||
case $# in
|
||||
2)
|
||||
year=$2
|
||||
day=$1
|
||||
specifyyear=_$year;;
|
||||
1)
|
||||
day=$1
|
||||
esac
|
||||
|
||||
file=input$day$specifyyear
|
||||
|
||||
cd ~/repos/advent2021 || exit 42
|
||||
curl -s -o "$file" -H "Cookie: session=$(cat cookie)" \
|
||||
"https://adventofcode.com/$year/day/$day/input"
|
||||
|
||||
git add "$file"
|
Loading…
Reference in New Issue