diff options
author | bd <bdunahu@operationnull.com> | 2024-06-16 22:17:54 -0600 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-06-16 22:17:54 -0600 |
commit | fd93afc17c30e480e437a28c6d495b521c0e7fb3 (patch) | |
tree | e42a78324668f5dfa10bda8cab078449d5d01e9d /doesnt-he-have-intern-elves-for-this/main.scm | |
parent | 5745b2875046d0bbe3bf25f1d03a297b624c55c6 (diff) |
AoC 2015.5 p1+2
Diffstat (limited to 'doesnt-he-have-intern-elves-for-this/main.scm')
-rw-r--r-- | doesnt-he-have-intern-elves-for-this/main.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doesnt-he-have-intern-elves-for-this/main.scm b/doesnt-he-have-intern-elves-for-this/main.scm new file mode 100644 index 0000000..756e54f --- /dev/null +++ b/doesnt-he-have-intern-elves-for-this/main.scm @@ -0,0 +1,17 @@ +;; -*- compile-command: "guile -L . -e main -s main.scm < input.txt"; -*- +(use-modules (dhhieft) + ((ice-9 rdelim)) + (ice-9 binary-ports)) + + +(define (stdin-to-str) + (let loop ((result "")) + (let ((line (read-line))) + (if (eof-object? line) + result + (loop (string-append result line "\n")))))) + +(define (main args) + (display (dhhieft (stdin-to-str) + (null? (cdr args)))) + (newline)) |