Hold-at-20 Turn

Pig is a folk jeopardy dice game with simple rules: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two decisions:

Problem:  Simulate a single turn of Pig where a player rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20.

Input Format:  (no input)

Output Format:

Sample Transcripts:

Roll: 4
Roll: 5
Roll: 6
Roll: 5
Turn total: 20

Roll: 3
Roll: 1
Turn total: 0

Roll: 5
Roll: 2
Roll: 3
Roll: 6
Roll: 5
Turn total: 21

Todd Neller