aboutsummaryrefslogtreecommitdiff
path: root/2023/01/puzzle-2.an
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-12-02 00:04:27 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-12-02 00:04:27 +0100
commitd1d98a31f9a62e1497bde38178b22075471eb3b1 (patch)
treed7117bfc16c27ca6af5d13a6866ee6d0a36058a9 /2023/01/puzzle-2.an
parentfbee8c65aa88b94e97b2cb6b29f615859bf34660 (diff)
Add 2023 day 1 solutions
Diffstat (limited to '2023/01/puzzle-2.an')
-rwxr-xr-x2023/01/puzzle-2.an17
1 files changed, 17 insertions, 0 deletions
diff --git a/2023/01/puzzle-2.an b/2023/01/puzzle-2.an
new file mode 100755
index 0000000..81638af
--- /dev/null
+++ b/2023/01/puzzle-2.an
@@ -0,0 +1,17 @@
+#!/usr/local/bin/andy
+
+sed -E '
+ s/one/&1&/g
+ s/two/&2&/g
+ s/three/&3&/g
+ s/four/&4&/g
+ s/five/&5&/g
+ s/six/&6&/g
+ s/seven/&7&/g
+ s/eight/&8&/g
+ s/nine/&9&/g
+' input
+| tr -d a-z
+| sed -E 's/(.).*(.)/\1\2/; s/^.$/&&/'
+| paste -sd+
+| bc