mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Merge pull request #500 from sechilds/fix_hamurabi_python
Fixes to the Python version of Hamurabi
This commit is contained in:
@@ -137,7 +137,7 @@ while Z < 11: # line 270. main loop. while the year is less than 11
|
|||||||
# REM *** ENOUGH GRAIN FOR SEED?
|
# REM *** ENOUGH GRAIN FOR SEED?
|
||||||
bad_input_710(S)
|
bad_input_710(S)
|
||||||
D = -99
|
D = -99
|
||||||
elif D >= 10 * P:
|
elif D > 10 * P:
|
||||||
# REM *** ENOUGH PEOPLE TO TEND THE CROPS?
|
# REM *** ENOUGH PEOPLE TO TEND THE CROPS?
|
||||||
print("BUT YOU HAVE ONLY", P, "PEOPLE TO TEND THE FIELDS! NOW THEN,")
|
print("BUT YOU HAVE ONLY", P, "PEOPLE TO TEND THE FIELDS! NOW THEN,")
|
||||||
D = -99
|
D = -99
|
||||||
@@ -154,6 +154,7 @@ while Z < 11: # line 270. main loop. while the year is less than 11
|
|||||||
if int(C / 2) == C / 2: # even number. 50/50 chance
|
if int(C / 2) == C / 2: # even number. 50/50 chance
|
||||||
# REM *** RATS ARE RUNNING WILD!!
|
# REM *** RATS ARE RUNNING WILD!!
|
||||||
E = int(S / C) # calc losses due to rats, based on previous random number
|
E = int(S / C) # calc losses due to rats, based on previous random number
|
||||||
|
|
||||||
S = S - E + H # deduct losses from stores
|
S = S - E + H # deduct losses from stores
|
||||||
|
|
||||||
C = gen_random()
|
C = gen_random()
|
||||||
|
|||||||
Reference in New Issue
Block a user