[Racket] Ferti hydroponic nutrient solver, redux.
Fix nutrient values doubling bug.
RTFM
models/crop-requirement.rkt
@@ -152,4 +152,4 @@
152
152
(for/fold ([acc acc])
153
153
([(nutrient value) (in-hash (crop-requirement-nutrient-values crop-requirement))])
154
154
(define contribution (* value weight))
155
Removed:
(hash-update acc nutrient (λ (old) (+ old contribution)) (λ () contribution)))))
155
Added:
(hash-update acc nutrient (λ (old) (+ old contribution)) 0))))