]> aoc.elinar.fr Git - aoc_2025/commitdiff
fix aoc script
authoralex <>
Mon, 8 Dec 2025 09:09:40 +0000 (10:09 +0100)
committeralex <>
Mon, 8 Dec 2025 09:09:40 +0000 (10:09 +0100)
Numbers where seen as octal numbers.

aoc

diff --git a/aoc b/aoc
index 964beb4d1c2b6094731cbc4da0959182b9d3d509..ba85a257f819aab349fd1f85423d0fe3b82bfcab 100755 (executable)
--- a/aoc
+++ b/aoc
@@ -24,14 +24,14 @@ get_input() {
     read_cookie
     curl -o input/$DAY.txt \
         -H "Cookie: session=$COOKIE" \
-        "https://adventofcode.com/2025/day/$(printf "%d" ${DAY/day/})/input"
+        "https://adventofcode.com/2025/day/${N}/input"
 }
 
 get_html() {
     read_cookie
     curl -o html/$DAY.html \
         -H "Cookie: session=$COOKIE" \
-        "https://adventofcode.com/2025/day/$(printf "%d" ${DAY/day/})"
+        "https://adventofcode.com/2025/day/${N}"
 }
 
 do_test() {
@@ -66,6 +66,8 @@ done
 while [ $# -ge 1 ]; do
     DAY=$1
     echo "day: $DAY"
+    N=${DAY/day0/}
+    N=${N/day/}
     [ $DO_HTML -eq 1 ] && get_html
     [ $DO_INPUT -eq 1 ] && get_input
     [ $DO_RUN -eq 1 ] && do_run