Pig example 4
User input is in bold. Note that this examples shows both players starting at 80 to keep the game shorter.
$ python3 pig.py What is the first player's name? Sherry What is the second player's name? Rich ------- Sherry: 80 Rich: 80 It's your turn, Sherry Sherry rolled a 5 Sherry earned 5 points so far this turn Do you want to roll again? yes Sherry rolled a 2 Sherry earned 7 points so far this turn Do you want to roll again? yes Sherry rolled a 3 Sherry earned 10 points so far this turn Do you want to roll again? yes Sherry rolled a 2 Sherry earned 12 points so far this turn Do you want to roll again? yes Sherry rolled a 5 Sherry earned 17 points so far this turn Do you want to roll again? yes Sherry rolled a 2 Sherry earned 19 points so far this turn Do you want to roll again? yes Sherry rolled a 5 Sherry earned 24 points so far this turn Do you want to roll again? no ------- Sherry: 104 Rich: 80 It's your turn, Rich Rich rolled a 4 Rich earned 4 points so far this turn Do you want to roll again? yes Rich rolled a 5 Rich earned 9 points so far this turn Do you want to roll again? yes Rich rolled a 3 Rich earned 12 points so far this turn Do you want to roll again? yes Rich rolled a 3 Rich earned 15 points so far this turn Do you want to roll again? yes Rich rolled a 3 Rich earned 18 points so far this turn Do you want to roll again? yes Rich rolled a 2 Rich earned 20 points so far this turn Do you want to roll again? yes Rich rolled a 4 Rich earned 24 points so far this turn Do you want to roll again? no Final scores ----------- Sherry: 104 Rich: 104 It's a tie!