Handbook
Glossary
<game> ( -- game )
Vocabulary
hamurabi
.
private
Inputs
None
Outputs
game
an
object
Definition
USING:
accessors
kernel
math
;
IN:
hamurabi.private
:
<game>
( -- game )
game
new
0
>>year
95
>>population
5
>>births
0
>>deaths
2800
>>stores
3000
>>harvest
3
>>yield
f
>>plague
0
>>cost
dup
births>>
[
+
]
curry
change-population
dup
population>>
>>total-births
dup
deaths>>
>>total-deaths
dup
[
harvest>>
]
[
yield>>
]
bi
/
>>acres
dup
[
harvest>>
]
[
stores>>
]
bi
-
>>eaten
;