master-blaster
Matthew Butterick 9 years ago
parent bc06eb4f54
commit 6199324ebc

@ -107,9 +107,9 @@ Since the only part that changes between the solutions is the bulb functions, we
(count-lights lights)) (count-lights lights))
(define (make-str-converter bulb-func-converter) (define (make-str-converter bulb-func-converter)
(λ (line) (λ (str)
(match-define (list* _ action coordinates) (match-define (list* _ action coordinates)
(regexp-match #px"^(.*?)(\\d+),(\\d+) through (\\d+),(\\d+)$" line)) (regexp-match #px"^(.*?)(\\d+),(\\d+) through (\\d+),(\\d+)$" str))
(list* (bulb-func-converter (string-trim action)) (list* (bulb-func-converter (string-trim action))
(map string->number coordinates)))) (map string->number coordinates))))