CSC103 PROJECT 4: MONOPOLY
Due on Friday, Nov. 14th
Description of Monopoly
The game of Monopoly is one of the best-selling games of all time. The game is played on a square board which has 11 slots on each side. A rough schematic of the board is:

All of the players begin the game on the Go square. If they should ever land on the Go to Jail square, they go directly to jail and their turn ends immediately. If they should ever land on the jail square, they are not in jail. They are just visiting.
A player's turn consist of one or more rolls of two 6-sided dice. The player begins by rolling the two dice. The number he rolled is the sum of the two dice. The player than moves in a clockwise direction that many squares. For example, a player at GO who rolls a four and a six would move to the Jail square. If the first roll in a turn was a double, the same player gets to move again by rolling the dice a second time. If the second roll is also a double, the player gets to move again in the same turn by rolling the dice a third time. Alas, if the third roll is also a double, the player ends his turn immediately by going to jail. So, in one turn, a player could land on three squares. For example, a player starting at X in the diagram above who rolls a three and a three, a two and two, and a three and a four would land on L1, L2 and L3 but if the same player had rolled a four and a four the third time, he would have landed on L1 and L2 only. We do not count going to jail as landing on the jail square.
If a player is in jail, the player must roll a double to get out of jail on his next turn. If he does not, he stays in jail and tries to get out on the next turn. If he rolls a double on the next turn, he exits jail. Otherwise , he stays there. The player gets out of jail on his third try no matter what. For example, a player in jail who rolls a three and a six on his first try to get out stays in jail and does not move in that turn. If on the second try to get out, he rolls a six and a six, he lands on the square two to the right of the "Free Parking" square.
Your Project
Write a program to simulate (i.e., imitate) 100 rounds of a Monopoly game assuming that there are four players Each player gets a turn in each round and the players get their turns in order. Your program must print out for each of the forty squares the number of times the square has been landed on during the 100 rounds. You should label the squares from 1 to 40 with the Go square being 1, the jail square being 11, etc. Note that you are printing how often anyone has landed on each square. When you land on "Go to Jail", count this as landing on square 31. Do not count going to jail as landing on square 11. Your output should be labeled and outputted as a table similar to the form shown below. In this sample, we have assumed that all squares were landed on exactly 30 times. This will not happen. We have shown only the first two lines of the output.
| SQUARE | LANDED | SQUARE | LANDED | SQUARE | LANDED |
|---|---|---|---|---|---|
| 1 | 30 | 2 | 30 | 3 | 30 |
| 4 | 30 | 5 | 30 | 6 | 30 |
Your program must use a function Turn(PlayerNumber, LandCount, InJail) where PlayerNumber is the number of the player moving. This function does everything for one player's turn. This function uses another function RollDice(...) which your program must have. RollDice rolls two dice, determines if the roll puts the person in jail, determines where the person lands, and updates the LandCount, InJail, and PlayerPos vectors. It returns a 0 if the player's turn is over after the roll and a 1 if it is not. It accepts several parameters some of which it will change. You will have to decide what parameters to send to the function. Notice that one player's turn could consist of three calls to RollDice.
Submit your program by e-mail using 103P4 in the subject heading The project is worth 50 points with 5 points off for each day late.