X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=garden.scm;h=bf6cc4879f3710a0f553530cc5e728ba92684baf;hb=refs%2Fheads%2Fmaster;hp=ebcdf77d3ef17d207d5a6a66366cf0fe7d1b7217;hpb=2d5ed850edc5bc73c2ceed3086866c0f410a278b;p=microbotany.git diff --git a/garden.scm b/garden.scm index ebcdf77..bf6cc48 100644 --- a/garden.scm +++ b/garden.scm @@ -1,14 +1,3 @@ -(import (chicken random) - (chicken time) - (chicken time posix) - (chicken pathname) - (chicken io) - (chicken string) - (chicken format) - (chicken file) - (chicken condition) - srfi-1 uri-common simple-sha1) - (define rand-double pseudo-random-real) (define (rand-weighted weights) @@ -86,7 +75,7 @@ (if last-watered (let* ((now (current-seconds)) (1day (* 24 3600)) - (remaining-pc (quotient (* 100 (- 1day (- now last-watered))) 1day)) + (remaining-pc (quotient (* 100 (max 0 (- 1day (- now last-watered)))) 1day)) (filled (quotient remaining-pc 4)) (unfilled (- 25 filled))) (print "["