day 1 in the books

This commit is contained in:
2025-12-01 20:44:46 -05:00
parent 3eb6aa5002
commit b3521f6253
3 changed files with 93 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
__year=2024
__year=2025
__day="${1}"
if [ "${__day}" == "" ]; then
@@ -8,15 +8,15 @@ if [ "${__day}" == "" ]; then
fi
padded=$(printf "%02g" ${__day})
mkdir -p ${padded}/inputs
touch ${padded}/inputs/testinput
if [ ! -f "${padded}/inputs/input" ]; then
mkdir -p src/resources/inputs/${padded}
touch src/resources/inputs/${padded}/testinput
if [ ! -f "src/resources/inputs/${padded}/input" ]; then
curl -s \
-A "https://git.yetaga.in/alazyreader/AdventOfCode${__year}/" \
-H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${__day##0}/input > "src/resources/inputs/${padded}/input"
fi
if [ ! -f "src/Day${padded}.java" ]; then
cp main.java.tmpl src/Day${padded}.java
gsed -i '' "s/00/${padded}/g" src/Day${padded}.java
sed -i '' "s/00/${padded}/g" src/Day${padded}.java
fi
open "https://adventofcode.com/${__year}/day/${__day##0}"