diff --git a/dice rolling simulator.py b/dice rolling simulator.py index 0116f83..647b65c 100644 --- a/dice rolling simulator.py +++ b/dice rolling simulator.py @@ -46,15 +46,24 @@ def roll_dice(): "-----", ), - } - roll = input("Roll the dice? (Yes/No) : ") - while roll.lower() == "Yes". lower(): - dice1 = random.randint(1, 6) - dice2 = random.randint(1, 6) + } - print("dice rolled: {} and {}". format(dice1, dice2)) + roll = input("Roll The Dice ? (y/n): ") + + while roll.lower() == "Y".lower(): + dice1 = random.randint(1,6) + dice2 = random.randint(1,6) + + #when you get same number from both dice, player quit game + if dice1 == dice2: + print("dice rolled: {} and {}".format(dice1, dice2)) + print("You lose !!") + quit() + + print("dice rolled: {} and {}".format(dice1, dice2)) print("\n".join(dice_drawing[dice1])) print("\n".join(dice_drawing[dice2])) - - roll = input("Roll again? (Yes/no): ") + + roll = input("Roll again? (y/n): ") + roll_dice()