Skip to content

Instantly share code, notes, and snippets.

@mducle
Last active December 5, 2023 13:20
Show Gist options
  • Save mducle/51fa7cc2094f9f0c1cf4b6775d879a09 to your computer and use it in GitHub Desktop.
Save mducle/51fa7cc2094f9f0c1cf4b6775d879a09 to your computer and use it in GitHub Desktop.
Advent of code 2023
echo $(sed s/[A-z]//g ~/Downloads/input | sed "s/\([0-9]\)/\1 /g" | awk '{print $1, $NF}'| sed "s/ //" | sed "s/$/+/") | sed "s/+$//"|bc
cp ~/Downloads/input tt && for ii in "one,o1e" "two,t2o" "three,t3e" "four,f4r" "five,f5e" "six,s6x" "seven,s7n" "eight,e8t" "nine,n9e"; do cm=$(echo $ii | awk -F, '{print "sed s/"$1"/"$2"/g tt > t2 && mv t2 tt"}'); echo $cm|bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment