aboutsummaryrefslogtreecommitdiff
path: root/advent-of-code/2023/lib/utils.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'advent-of-code/2023/lib/utils.rkt')
-rw-r--r--advent-of-code/2023/lib/utils.rkt11
1 files changed, 9 insertions, 2 deletions
diff --git a/advent-of-code/2023/lib/utils.rkt b/advent-of-code/2023/lib/utils.rkt
index 946bb86..40c6f6b 100644
--- a/advent-of-code/2023/lib/utils.rkt
+++ b/advent-of-code/2023/lib/utils.rkt
@@ -1,7 +1,14 @@
-#lang racket
+#lang racket/base
(provide get-lines
- enumerate)
+ enumerate
+ repeat)
+
+(define (repeat n e)
+ (let loop ((i 0) (ret '()))
+ (if (>= i n)
+ ret
+ (loop (+ 1 i) (cons e ret)))))
(define (get-lines fp)
(let loop ((lines '()))