Question
I am planning to code for a text-based Monopoly game without using arrays, complex global variables any other complex stuff from the C Langauge. Following
I am planning to code for a text-based Monopoly game without using arrays, complex global variables any other complex stuff from the C Langauge. Following are some of the detail of the program. I can only use #include
When the dice are rolled and the prime number is rolled, for instance, the user will have to pay either 100 or 200 based on the number that is randomly generated.The user in essence has to code the random number generator b/w to numbers.
Menu driven prgrm. Less Yes or No Questions. New game only when user chooses to do so and quits when the user chooses the respective exit option
The board The Users take turns similar to monopoly in moving around the board. It has 10 spaces (position 0 to position 9). 3 TELEPHONE LAKE COMPANY BEACH HOUSE COST-150) HOUSE TAIL TIME TEXT MISS NEXT called a od BASED TURN MONOPOLY TOWER FARMHOUSE 6 RAILROAD ? R16LOOK COST100 ROLL 2 DICE cs Scanned with CamScanner GO S. Users have no real estate in the beginning. The Bank owns all of the properties on the board as in the case with the real monopoly game. Similar to the monopoly board game, they have infinite cash and are also owners of the properties that are available for purchase and are initially not renovated 2 users start from 0 position .. They can use this to buy properties or pay rent during the game. Initially, both players are at Go (position 0). Possible Positions- Jail Time (position 4), ? (position 6), house properties at positions (1, 3, 5, 8, 9,) ( Telephone company at position 2), Railroad (position 7) Basic Rules Upon Player lands on a property. Users can purchase the specific asset from the bank User has to pay the specific cost of the asset to the bank. If the user lands on an asset that is possessed by the corresponding user, the user has to pay the corresponding user who possesses the respective asset the rent. . If the user asset is a house property that is possessed by the same user, the user can do nothing or renovate (Price-50) If the user lands on the property that is either not a house property or is a house property that the user has already renovated, the user does nothing User lands on Jail Time - The player loses his next turn. (Normal Monopoly Rules) User lands on or passes by Go.- The player gets 200 from the Bank (Normal Monopoly Rules) User lands on? - The player rolls a dice to determine his luck. When one user goes bankrupt, the game ends and the user is declared the winner Buying properties When a player lands on a Bank-owned property, he or she has the option to purchase it from the Bank by paying the property cost. The player must have enough cash on hand to cover the cost of the property, else, he will be unable to purchase it If user lands on Telephone Company (Price-150) If user lands on Railroad (Price-100). House Properties (1,3,5,8,9) Cost is computed (not stored) by multiplying 20 to the remainder the position of the property when divided by 7 Eng. Tree House at position 1 costs 20. Farmhouse at position 9 costs 40 Paying rent When a player lands on another player's property, he must pay the owner rent for that property. Landing on the Telephone Company will cost you 8 times the value of the die you rolled. Eg:, P1 is at the Farm House right now (position 9). The value of the dice rolled by Player 1 is 3. Player 1 advances three places and arrives on Player 2's Telephone Company (position 2). Player 1 pays Player 2 the rent for landing on the Telephone Company, which is 24 (8 *3 = 24). Railroad (Price - 35) House Properties (1,3,5,8,9) The rent of the house properties is computed based on its cost. The rent of an unrenovated property is one-fifth of its cost. The rent of a renovated property is one plus twice the rent (unrenovated). E.g. The cost of the Beach House (position 3) is 60. The rent is 12. If it has been renovated, its rent is 25. Insufficient cash! When a user doesn't even have sufficient cash on hand to pay rent, user can sell all of it's properties back to the Bank the user recoupes sufficient cash to pay for the rent The player chooses a home to sale to the Bank (one property at a time). The property's resale value is half of its original cost. When all of a player's assets are sold to the bank and his cash is insufficient to pay the rent, the player is declared bankrupt, and the game is over. When a player lands on ? (position 6), the player rolls the dice to determine his luck. His luck is determined by the dice value. Dice Value If Dice Valle is pume -> User collects money from Bank Doo, 200] Il Dice Valle is not prime = user pays money toanta C50, 100] I Dice value is 1 > usorg has to be in jail (Skips next turn) Extra Notes 1. When it comes to renovated buildings, cost and rent must all be calculated. They can't be stored in seperate variables or arrays. 2.Arrays or 7 separate variables can't be used to keep record of the possession of the properties. They have to computed as the the 9-digit integer. Ex- 9-Digit-Integer 000x0x000 Each digit corresponds to one property on the board The first digit from the right is the status of the Lake House (Prop 1) The second digit from the right is for Telephone Company (Prop2), the third digit from the right is for Beach House (Prop3), and so on.. The leftmost digit (9th digit from right) is the status of the FarmHouse(Prop9) The digits on each property are updated when a player buys, renovates, or resells a property Owns the property Renovates the property User 1 1 3 User 2 2 4 Bank 0 Not Applicable The 4th and 6th digit from the right can be any digit since these are Jail Time and ? that are not owned by any of the respective users
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started