diff options
author | lamp | 2023-12-02 12:11:50 +0000 |
---|---|---|
committer | lamp | 2023-12-02 12:11:50 +0000 |
commit | 78232b574dc4eba001d536a865c115582c4e2325 (patch) | |
tree | b20548f93b11b40e7d53cb9b60353ca114fa49bc /2-2.scm | |
parent | a280deda223102a64e59c50a5adb7d4b700a07de (diff) |
day 2: tidy
Diffstat (limited to '2-2.scm')
-rwxr-xr-x | 2-2.scm | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -4,10 +4,6 @@ (ice-9 textual-ports) (srfi srfi-1)) -(define red-max 12) -(define green-max 13) -(define blue-max 14) - (define (read-lines port) (letrec ((loop (lambda (l ls) (if (eof-object? l) @@ -28,9 +24,8 @@ (values (map triplet-values rest)) (red-min (fold (lambda (x y) (if (> x y) x y)) 0 (map car values))) (green-min (fold (lambda (x y) (if (> x y) x y)) 0 (map cadr values))) - (blue-min (fold (lambda (x y) (if (> x y) x y)) 0 (map caddr values))) - (power (* red-min green-min blue-min))) - power)) + (blue-min (fold (lambda (x y) (if (> x y) x y)) 0 (map caddr values)))) + (* red-min green-min blue-min))) (let* ((port (open-input-file "2.txt")) (lines (read-lines port))) |