summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-18 00:53:14 -0500
committerJune McEnroe <june@causal.agency>2020-12-18 00:53:14 -0500
commit6c7336937b4ccb0c72b54035d4f1ee16761f040d (patch)
tree610a7aca387a489bdb63c6afa9b1580ac8adc2fc
parentSolve day 18 part 1 (diff)
downloadaoc-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
-rw-r--r--2020/day18-2.sh9
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
r'>2020-08-15Just use CLOCK_MONOTONIC and clean up includesJune McEnroe CLOCK_MONOTONIC exists everywhere. 2020-08-15Reap childrenJune McEnroe 2020-08-14Implement serviceSignal, serviceStop, serviceRestartJune McEnroe 2020-08-14Reset restartInterval and restartDeadline on startJune McEnroe 2020-08-14Switch to timespec for timeoutsJune McEnroe Can be passed to ppoll(2) directly. 2020-08-14Implement serviceStartJune McEnroe 2020-08-14Flesh out Service structJune McEnroe 2020-08-14Build environment for servicesJune McEnroe 2020-08-14Implement spawntab parsingJune McEnroe 2020-08-14Open syslog, daemonize, write PIDJune McEnroe 2020-08-14Implement user and group lookupJune McEnroe 2020-08-14Add install targetJune McEnroe 2020-08-14Add spawnd skeletonJune McEnroe