more simplification

main
Inga 🏳‍🌈 12 months ago
parent 1915978029
commit 5443e45700
  1. 6
      day01-easy/main.scm

@ -44,12 +44,12 @@
(define (sum numbers) (reduce numbers + 0)) (define (sum numbers) (reduce numbers + 0))
(define (is-numeric-char char) (if (char-numeric? char) #t #f))
(define (solve-line line) (define (solve-line line)
( (
(lambda (first-last-result) (string->number (list->string first-last-result))) (lambda (first-last-result) (string->number (list->string first-last-result)))
(first-last (first-last (string->list line) is-numeric-char)))
(string->list line)
(lambda (char) (if (char-numeric? char) #t #f)))))
(define (solve-all lines) (define (solve-all lines)
(sum (map lines solve-line))) (sum (map lines solve-line)))

Loading…
Cancel
Save