From 496f83129c19f608cc34d1991be8e29dfd95aa6b Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Mon, 6 May 2024 10:15:22 +0200 Subject: [PATCH] Test and fix Circus disablement --- data-generator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data-generator.py b/data-generator.py index 07deb44..cc7c5cf 100644 --- a/data-generator.py +++ b/data-generator.py @@ -37,9 +37,9 @@ class Circus: if self.state == 0: print("Circus is not or no longer in game.") return False - print("Player obtained a " + self.wagons[self.state - 1] + "circus sticker!") + print("Player obtained a " + self.wagons[self.state - 1] + " circus sticker!") self.state = self.state + 1 - if self.state == len(self.wagons) - 1: + if self.state > len(self.wagons): print("Circus stickers are now depleted.") self.state = 0 # effectively disable circus @@ -154,5 +154,11 @@ myGame = Game() myGame.initGame(playersNb) myGame.printStatus() myGame.circus.enable() +myGame.circus.state = 19 myGame.printStatus() print(myGame.circus.wagons) +myGame.circus.takeWagon() +myGame.printStatus() +print(myGame.circus.wagons) +myGame.circus.takeWagon() +myGame.printStatus()