README and misc

This commit is contained in:
OMGOMG 2021-12-07 15:43:00 +01:00
parent cad67794c3
commit fdeb6e3b64
4 changed files with 53 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
gettoday merge=ours

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
*.sw?
aids
__pycache__/
tmp
a.out
response*
*.hi
*.o

25
README.md Normal file
View File

@ -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
```

19
gettoday Executable file
View File

@ -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"