diff options
author | June McEnroe <june@causal.agency> | 2020-12-18 00:53:14 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-12-18 00:53:14 -0500 |
commit | 6c7336937b4ccb0c72b54035d4f1ee16761f040d (patch) | |
tree | 610a7aca387a489bdb63c6afa9b1580ac8adc2fc /2020 | |
parent | Solve day 18 part 1 (diff) | |
download | aoc-6c7336937b4ccb0c72b54035d4f1ee16761f040d.tar.gz aoc-6c7336937b4ccb0c72b54035d4f1ee16761f040d.zip |
Solve day 18 part 2
Is it cheating to implement the FORTRAN I approach[1] as preprocessing? Maybe. [1]: https://en.wikipedia.org/wiki/Operator-precedence_parser#Alternative_methods
Diffstat (limited to '2020')
-rw-r--r-- | 2020/day18-2.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/2020/day18-2.sh b/2020/day18-2.sh new file mode 100644 index 0000000..1f49446 --- /dev/null +++ b/2020/day18-2.sh @@ -0,0 +1,9 @@ +#!/bin/sh +sed ' +s/(/&((/g +s/)/))&/g +s/*/))*((/g +s/+/)+(/g +s/^/((/ +s/$/))/ +' | ./day18 |