mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-12 15:50:20 -08:00
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.
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?
|
||||
bad_input_710(S)
|
||||
D = -99
|
||||
elif D >= 10 * P:
|
||||
elif D > 10 * P:
|
||||
# REM *** ENOUGH PEOPLE TO TEND THE CROPS?
|
||||
print("BUT YOU HAVE ONLY", P, "PEOPLE TO TEND THE FIELDS! NOW THEN,")
|
||||
D = -99
|
||||
|
||||
Reference in New Issue
Block a user