diff --git a/solutions/dicegame/runner.py b/solutions/dicegame/runner.py index 7456360..d7c3085 100644 --- a/solutions/dicegame/runner.py +++ b/solutions/dicegame/runner.py @@ -1,4 +1,4 @@ -from .die import Die +from .die import Die, roll from .utils import i_just_throw_an_exception class GameRunner: @@ -21,12 +21,14 @@ def answer(self): @classmethod def run(cls): - count = 0 + consecutive_wins = 0 runner = cls() while True: print("Round {}\n".format(runner.round)) + roll(runner.dice) + for die in runner.dice: print(die.show()) @@ -36,18 +38,17 @@ def run(cls): if guess == runner.answer: print("Congrats, you can add like a 5 year old...") runner.wins += 1 - count += 1 - runner.consecutive_wins += 1 + consecutive_wins += 1 else: print("Sorry that's wrong") print("The answer is: {}".format(runner.answer)) print("Like seriously, how could you mess that up") runner.loses += 1 - count = 0 + consecutive_wins = 0 print("Wins: {} Loses {}".format(runner.wins, runner.loses)) runner.round += 1 - if count == 6: + if consecutive_wins == 6: print("You won... Congrats...") print("The fact it took you so long is pretty sad") break