summaryrefslogtreecommitdiff
path: root/trebuchet/main.scm
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2024-06-10 16:31:02 -0600
committerbd <bdunahu@operationnull.com>2024-06-10 16:31:02 -0600
commit9e149cb6e6f1bf002fb1abc2b79c77afc3d1d36c (patch)
tree65621c8bb1fd326574f0a62191185d477c60b642 /trebuchet/main.scm
parent58ee9f48c4c90352bccdb1cc88d7b9ef923f9216 (diff)
AoC 2023.1 p1+2
Diffstat (limited to 'trebuchet/main.scm')
-rw-r--r--trebuchet/main.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/trebuchet/main.scm b/trebuchet/main.scm
new file mode 100644
index 0000000..f96ba5d
--- /dev/null
+++ b/trebuchet/main.scm
@@ -0,0 +1,17 @@
+;; -*- compile-command: "guile -L . -e main -s main.scm < input.txt"; -*-
+(use-modules (t)
+ ((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 (t (stdin-to-str)
+ (null? (cdr args))))
+ (newline))