mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-06 12:51:27 -08:00
Merge pull request #893 from GKnirps/king_python_pollution_reason
Fix pick of pollution reason in python King
This commit is contained in:
@@ -6,6 +6,7 @@ https://www.atariarchives.org/basicgames/showpage.php?page=2
|
||||
|
||||
import random
|
||||
|
||||
|
||||
cards = {
|
||||
2: "2",
|
||||
3: "3",
|
||||
@@ -22,6 +23,7 @@ cards = {
|
||||
14: "Ace",
|
||||
}
|
||||
|
||||
|
||||
def play_game() -> None:
|
||||
cash = 100
|
||||
while cash > 0:
|
||||
|
||||
@@ -131,17 +131,17 @@ class GameState:
|
||||
tourist_trade_earnings = V1 - V2
|
||||
print(f" YOU MADE {tourist_trade_earnings} RALLODS FROM TOURIST TRADE.")
|
||||
if V2 != 0 and not (V1 - V2 >= self.tourism_earnings):
|
||||
print(" DECREASE BECAUSE ")
|
||||
print(" DECREASE BECAUSE ", end="")
|
||||
reason = randint(0, 10)
|
||||
if reason <= 2:
|
||||
print("FISH POPULATION HAS DWINDLED DUE TO WATER POLLUTION.")
|
||||
if reason <= 4:
|
||||
elif reason <= 4:
|
||||
print("AIR POLLUTION IS KILLING GAME BIRD POPULATION.")
|
||||
if reason <= 6:
|
||||
elif reason <= 6:
|
||||
print("MINERAL BATHS ARE BEING RUINED BY WATER POLLUTION.")
|
||||
if reason <= 8:
|
||||
elif reason <= 8:
|
||||
print("UNPLEASANT SMOG IS DISCOURAGING SUN BATHERS.")
|
||||
if reason <= 10:
|
||||
else:
|
||||
print("HOTELS ARE LOOKING SHABBY DUE TO SMOG GRIT.")
|
||||
|
||||
# NOTE: The following two lines had a bug in the original game:
|
||||
|
||||
Reference in New Issue
Block a user