Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Childs
94a65239d5 Allow max fields to be worked in python Hamurabi.
In the BASIC version the calculation is on line 455:

`455 IF D<10*P THEN 510`

Which skips over the not enough people message.

In the Python version the logic is reversed, and we check
to see if there is too few people and then run the message:

`elif D >= 10 * P` (in the current code).

However, this means that the case where you want to plant the
maximum number of acres won't work.

e.g. You have 100 people (P) and want to plant 1000 acres (D).

`1000 >= 10 * 100`
`1000 >= 1000`

Which triggers the "not enough people code".

Maybe this is a bug in the original program.
2022-01-13 11:04:43 -05:00
Stephen Childs
6c1adde205 Move harvest calculation outside rat condition.
This fixes an error where the harvest was only added
to the total bushels if rats ate some.

Note in the BASIC file, we check to see if rats eat
the grain in line 522 and if not, go to line 530,
which is where the `S=S-E+H` calculation is done.
2022-01-13 10:56:50 -05:00
Bill Cruise
a360ca17ca Return a value from gen_random function. 2022-01-08 13:18:09 -05:00
Bill Cruise
d5a2260796 Reformat to make code more Pythonic and (hopefully) readable. 2022-01-08 12:56:44 -05:00
Chris Reuter
d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00