hey, re-use first two steps!

This commit is contained in:
2021-12-20 13:24:26 +01:00
parent a7cb6fae09
commit 596f326726

View File

@@ -67,10 +67,10 @@
(image (begin
(get-line file) ; skip empty line
(file->matrix file)))]
(let [(enhanced (enhance image enhancer 2))]
(let [(enhanced-2 (enhance image enhancer 2))]
(printf "part 1:~% Lit pixels after enhancing twice: ~a~%"
(matrix-sum enhanced)))
(let [(enhanced (enhance image enhancer 50))]
(printf "part 2:~% Lit pixels after enhancing fifty times: ~a~%"
(matrix-sum enhanced))))))
(matrix-sum enhanced-2))
(let [(enhanced-50 (enhance enhanced-2 enhancer 48))]
(printf "part 2:~% Lit pixels after enhancing fifty times: ~a~%"
(matrix-sum enhanced-50)))))))