Even better way to have different return types, also added script to setup template

This commit is contained in:
2022-12-06 01:26:17 +01:00
parent 5554cfedb3
commit ee9dcc92c1
9 changed files with 87 additions and 102 deletions

15
2022/new.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
day=$1
type=$2
default=$3
test=$4
echo "Creating file from template..."
sed -e "s/DAY/$day/g" -e "s/TYPE/$type/" -e "s/DEFAULT/$default/" -e "s/TEST/$test/" ./template.rs > ./src/bin/day${day}.rs
echo "Downloading input..."
source ../.env
mkdir -p input/$1
curl -s "https://adventofcode.com/2022/day/$1/input" -H "Cookie: session=${SESSION}" > input/$1/input
echo "Done!"