CIT 590 Assignment 2: Pig
  Fall 2016, David Matuszek

Purposes of this assignment

General idea of the assignment

"Pig" is a very simple game. Two players take turns; on each turn, a player rolls a six-sided die ("die" is the singular of "dice") as many times as she wishes, or until she rolls a 1. Each number she rolls, except a 1, is added to her score this turn; but if she rolls a 1, her score for this turn is zero, and her turn ends. At the end of each turn, the score for that turn is added to the player's total score. The first player to reach or exceed 100 wins.

For example:

As defined above, the first player has an advantage. To make the game more fair, we will say that if the first player reaches or exceeds 100, the second player gets one additional turn. (If the second player is the first to reach 100, the first player does not get an additional turn.)

Your assignment is to implement the game of Pig. You will play against the computer. The computer always goes first, so you get one more turn if the computer is the first to reach 100.

If both players are tied with 100 or more, each gets another turn until the tie is broken.

Specific functions

Define and use at least the following functions:
Every function should have a "doc comment" telling what it does. Also, begin the program with a comment giving your name and a brief description of the program.

Due date

Submit your file to Canvas by 11:59pm Tuesday, September 13. Since this will be a single file, there is no need to zip it.

Only files submitted to Canvas will be accepted. I do not accept assignments submitted by email.