From 58ee9f48c4c90352bccdb1cc88d7b9ef923f9216 Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 10 Jun 2024 12:26:20 -0600 Subject: AoC 2015.3 p1+2 --- perfectly-spherical-houses-in-a-vacuum/main.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 perfectly-spherical-houses-in-a-vacuum/main.scm (limited to 'perfectly-spherical-houses-in-a-vacuum/main.scm') diff --git a/perfectly-spherical-houses-in-a-vacuum/main.scm b/perfectly-spherical-houses-in-a-vacuum/main.scm new file mode 100644 index 0000000..9ce9361 --- /dev/null +++ b/perfectly-spherical-houses-in-a-vacuum/main.scm @@ -0,0 +1,16 @@ +;; -*- compile-command: "guile -L . -e main -s main.scm < input.txt"; -*- +(use-modules (pshiav) + ((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 (pshiav (stdin-to-str) (string->number (cadr args)))) + (newline)) -- cgit v1.2.3