From 9e149cb6e6f1bf002fb1abc2b79c77afc3d1d36c Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 10 Jun 2024 16:31:02 -0600 Subject: AoC 2023.1 p1+2 --- trebuchet/main.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 trebuchet/main.scm (limited to 'trebuchet/main.scm') 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)) -- cgit v1.2.3