mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
Add documentation for tourist trade bug in King
- really bad pollution can get positive money from tourists - fix issue in python implementation, other implementations still lack it
This commit is contained in:
@@ -61,7 +61,7 @@ class GameState:
|
||||
return self.countrymen - self.population_change
|
||||
|
||||
def sell_land(self, amount: int) -> None:
|
||||
assert amount < self.farmland
|
||||
assert amount <= self.farmland
|
||||
self.land -= amount
|
||||
self.rallods += self.land_buy_price * amount
|
||||
|
||||
@@ -126,7 +126,9 @@ class GameState:
|
||||
def handle_tourist_trade(self) -> None:
|
||||
V1 = int(self.settled_people * 22 + random() * 500)
|
||||
V2 = int((INITIAL_LAND - self.land) * 15)
|
||||
tourist_trade_earnings = int(V1 - V2)
|
||||
tourist_trade_earnings = 0
|
||||
if V1 > V2:
|
||||
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 ")
|
||||
|
||||
Reference in New Issue
Block a user