more simplification

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

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

Loading…
Cancel
Save