This commit is contained in:
yosh 2023-12-01 15:31:30 -05:00
commit 0ff78355b1
3 changed files with 1027 additions and 0 deletions

22
01.awk Normal file
View File

@ -0,0 +1,22 @@
BEGIN { FS=""; OFS=""; s = 0 }
# since this is destructive, p1 and p2 are separate
# to use p2 add -v p=2
p == 2 {
gsub(/one/, "on1ne");
gsub(/two/, "tw2wo");
gsub(/three/, "thre3hree");
gsub(/four/, "fou4our");
gsub(/five/, "fiv5ive");
gsub(/six/, "si6ix");
gsub(/seven/, "seve7even");
gsub(/eight/, "eigh8ight");
gsub(/nine/, "nin9ine");
}
{
gsub(/[^0-9]/, "")
s += $1$NF
}
END { print s }

1000
01_input Normal file

File diff suppressed because it is too large Load Diff

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# aoc 2023
no promises
1. awk
- `-v p=2` for part 2