aboutsummaryrefslogtreecommitdiff
path: root/2024/aoc-utils.scm
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2024-12-03 10:19:28 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2024-12-03 10:19:28 -0300
commit789d38b8594cf73a8f6ed306b8ed90529f9c1210 (patch)
tree5560e25c3f1a5a5eea67fa759d4736c97fe369af /2024/aoc-utils.scm
parent2e633775d14eaa246af901b0d64542192f3c2810 (diff)
downloadadvent-of-code-789d38b8594cf73a8f6ed306b8ed90529f9c1210.tar.gz
Add day03 - 2024
Diffstat (limited to '2024/aoc-utils.scm')
-rw-r--r--2024/aoc-utils.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/2024/aoc-utils.scm b/2024/aoc-utils.scm
index 98e83cd..5deb269 100644
--- a/2024/aoc-utils.scm
+++ b/2024/aoc-utils.scm
@@ -4,6 +4,7 @@
#:use-module (ice-9 regex)
#:use-module (ice-9 rdelim)
#:export (file->list
+ file->str
lines->number-list))
(define (file->list filename)
@@ -11,6 +12,9 @@
; Remove EOF token
(take lines (1- (length lines)))))
+(define (file->str filename)
+ (call-with-input-file filename read-string))
+
(define (lines->number-list lines)
(map (lambda (line)
(map string->number (string-split line #\Space)))