mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-31 15:07:42 -08:00
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.
This commit is contained in:
@@ -154,7 +154,8 @@ 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
|
||||
# REM *** RATS ARE RUNNING WILD!!
|
||||
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()
|
||||
# REM *** LET'S HAVE SOME BABIES
|
||||
|
||||
Reference in New Issue
Block a user