diff options
author | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-12-03 10:19:28 -0300 |
---|---|---|
committer | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-12-03 10:19:28 -0300 |
commit | 789d38b8594cf73a8f6ed306b8ed90529f9c1210 (patch) | |
tree | 5560e25c3f1a5a5eea67fa759d4736c97fe369af /2024/aoc-utils.scm | |
parent | 2e633775d14eaa246af901b0d64542192f3c2810 (diff) | |
download | advent-of-code-789d38b8594cf73a8f6ed306b8ed90529f9c1210.tar.gz |
Add day03 - 2024
Diffstat (limited to '2024/aoc-utils.scm')
-rw-r--r-- | 2024/aoc-utils.scm | 4 |
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))) |