]> gitweb.factorcode.org Git - factor.git/commitdiff
hamurabi: fix #percent-died.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 28 Jan 2019 05:34:49 +0000 (21:34 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 28 Jan 2019 05:34:49 +0000 (21:34 -0800)
extra/hamurabi/hamurabi.factor

index 3945cee0c4fcf76b9a89bc693def30545ec86b13..8074580c580cf96c6b1fcf5d2612530d28082e51 100644 (file)
@@ -24,9 +24,9 @@ total-births total-deaths ;
         3 >>yield
         f >>plague
         0 >>cost
-    dup births>> >>total-births
-    dup deaths>> >>total-deaths
     dup births>> '[ _ + ] change-population
+    dup population>> >>total-births
+    dup deaths>> >>total-deaths
     dup [ harvest>> ] [ yield>> ] bi / >>acres
     dup [ harvest>> ] [ stores>> ] bi - >>eaten ;
 
@@ -47,7 +47,7 @@ total-births total-deaths ;
     [ harvest>> ] [ eaten>> ] bi - ;
 
 : #percent-died ( game -- n )
-    [ total-deaths>> 100 * ] [ total-births>> ] [ year>> ] tri / / ;
+    [ total-deaths>> ] [ total-births>> ] bi / 100 * ;
 
 : #births ( game -- n )
     {
@@ -63,7 +63,7 @@ total-births total-deaths ;
 : leave-fink ( -- )
     "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" print
     "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE" print
-    "ALSO BEEN DECLARED 'NATIONAL FINK' !!" print ;
+    "ALSO BEEN DECLARED 'NATIONAL FINK'!!!!" print ;
 
 : leave-starved ( game -- game )
     dup deaths>> "YOU STARVED %d PEOPLE IN ONE YEAR!!!\n" printf