diff options
author | Matias Linares <matias@deprecated.org> | 2024-12-01 21:54:12 -0300 |
---|---|---|
committer | Matias Linares <matias@deprecated.org> | 2024-12-01 21:54:12 -0300 |
commit | f9f11695270872f7cf8c6616274bb2ef340575ec (patch) | |
tree | 570f8f97dfa8d463d3da9289c7cd7ddcafb6580e /2024/aoc-utils.scm | |
parent | a73cbbc18cb365cfcb069cb712f55dc30325c974 (diff) | |
download | advent-of-code-f9f11695270872f7cf8c6616274bb2ef340575ec.tar.gz |
Add 2024
Diffstat (limited to '2024/aoc-utils.scm')
-rw-r--r-- | 2024/aoc-utils.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/2024/aoc-utils.scm b/2024/aoc-utils.scm new file mode 100644 index 0000000..6b57aa5 --- /dev/null +++ b/2024/aoc-utils.scm @@ -0,0 +1,11 @@ +(define-module (aoc-utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 regex) + #:use-module (ice-9 rdelim) + #:export (file->list)) + +(define (file->list filename) + (let ((lines (string-split (call-with-input-file filename read-string) #\Newline))) + ; Remove EOF token + (take lines (1- (length lines))))) |