adventofcode

https://adventofcode.com/
Log | Files | Refs

commit c34b4664c98c6bfd99ef11008ddc4df63ba6732c
parent 3e57f1ebeb9076f92c91773218a3dd498a493840
Author: mpizzzle <m@michaelpercival.xyz>
Date:   Thu, 17 Dec 2020 13:35:02 +0000

minor refactoring

Diffstat:
M2020/puzzle_4.scm | 9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/2020/puzzle_4.scm b/2020/puzzle_4.scm @@ -1,12 +1,5 @@ (load "read_lines.scm") - -(define (tokenize str chr) - (let ((in (memq chr (string->list str))) - (idx (lambda (s c) (- (string-length s) (length (memq c (string->list s))))))) - (if in - (cons (substring str 0 (idx str (car in))) - (tokenize (substring str (+ (idx str (car in)) 1) (string-length str)) chr)) - (cons str '())))) +(load "tokenize.scm") (define (right-fold passports) (if (not (null? passports))