27.2. Monopoly
Requirements in iteration-3 include:
- Again, implement a basic, key scenario of the Play Monopoly Game use case: players moving around the squares of the board. And as before, run the game as a simulation requiring no user input, other than the number of players. However, in iteration-3 more of the complete set of rules apply. These are described in the following points.
- There are now Lots, Railroads, and Utility squares. When a player lands on a Lot, Railroad or Utility square, the following logic applies…
- If the Lot, Railroad or Utility square is not owned, the player who landed on the square may buy it. If they buy it, the price of the Lot, Railroad or Utility square is deducted from the player's money and the player becomes its owner.
- The price is set when the game starts, but is arbitraryfor example, the official Monopoly prices may be used.
- If the Lot, Railroad or Utility square is owned by the player that landed on it, nothing happens.
- If the Lot, Railroad or Utility square is owner by a player other than the player that landed on it, the player that landed on the square must pay its owner rent. The rent calculations are:
- Lot rent is ( index position ) dollars; e.g., if position 5, then $5.
- Railroad rent is 25 dollars times the number of Railroads owned by the owner; e.g., if own 3 Railroads, then $75.
- Utilities rent is 4 times the number shown on the dice when the player lands on the square (do not roll again)