Pig example 2
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? Charlie What is the second player's name? Lauri ------- Charlie: 80 Lauri: 80 It's your turn, Charlie Charlie rolled a 6 Charlie earned 6 points so far this turn Do you want to roll again? yes Charlie rolled a 5 Charlie earned 11 points so far this turn Do you want to roll again? yes Charlie rolled a 6 Charlie earned 17 points so far this turn Do you want to roll again? yes Charlie rolled a 3 Charlie earned 20 points so far this turn Do you want to roll again? no ------- Charlie: 100 Lauri: 80 It's your turn, Lauri Lauri rolled a 4 Lauri earned 4 points so far this turn Do you want to roll again? yes Lauri rolled a 4 Lauri earned 8 points so far this turn Do you want to roll again? yes Lauri rolled a 4 Lauri earned 12 points so far this turn Do you want to roll again? yes Lauri rolled a 3 Lauri earned 15 points so far this turn Do you want to roll again? yes Lauri rolled a 4 Lauri earned 19 points so far this turn Do you want to roll again? yes Lauri rolled a 1 You pigged out! Final scores ----------- Charlie: 100 Lauri: 80 Charlie wins!