You are asked to implement Chutes and ladder game, but with specific rules. You MUST use...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are asked to implement Chutes and ladder game, but with specific rules. You MUST use functions to implement your code. Game rules: 1- We will use two dices, each will be generated randomly (1-6 included). 2- In this game, we will have two Al players. 3- At each round, each player will roll the dices once. 4- Target is whoever reaches 100 or above first win. 5- Chutes rules: a. If a player stands on "14" needs to move back to "2" b. If a player stands on "99" needs to move back to "50" 6- Ladder rules: a. If a player stands on "8" needs to move to "34" b. If a player stands on "20"needs to move to "90"] Implementation: 1- Display a message to the user, with the name and the rules of the game Welcome to snack and ladder We have two players, Both are AI players First one to reach 100 or above is the winner 2- Display the board game to the screen as well. (you can create your own design, below is a sample, the board should end at 100) Lets play: 1 I I 1 1 1 11 75 16 | I T 21 I I I 46 I 26 I 1 51 I 31 | I 36 I 1 41 I I I I 71 56 | 1 61 | 1 66 I 1 21 71 12 1 I 17 I 1 22 II 27 I I 32 1 1 42 1 1 37 1 1 1 I 47 52 1 I 57 | 1 62 1 I 67 1 1 72 1 A 3 T I 8 I 13 18 1 23 I 43 48 1 28 I | 53 33 | | 38 1 1 63 68 73 I I T 58 | I I I 1 T I 1 | T 1 1 1 1 9 I I 1 14 T 1 19 I T 24 | I 1 included). "See if you need to pass parameters" 29 1 34 1 39 44 49 54 I 1 59 | I 64 | I 69 1 71 I 5 I 10 15 20 25 30 35 45 50 60 I 40 I 65 1 I 75 1 1 55 1 I I I 1 70 1 3- rand_dice() function: This function will be used to roll the dice randomly (1-6 both 4- roll_chutes() function: This function will be used to update the value of player depending on the rules of chutes. "See if you need to pass parameters" 5- roll ladder() function: This function will be used to update the value of player depending on the rules of ladder. "See if you need to pass parameters" 6- players() function: This function will be used to call the above functions, where you need to roll the dices, check if you need to update the values depending on chutes or ladder? "See if you need to pass parameters" 7- play() function: This function is your important one, as you need to define your players and start the game rounds and announce the winner (player reaches 100 or above first) 8- Below is a sample output: Let's start Round: 1 Player 1 turn: Rolling the dice You got dicel: 1 Total moves: 4 Round: 1 Player 2 turn: Rolling the dice You got dicel: 3, dice 2: 5 **YOU ARE LUCKY** Total moves: 34 I 1 | | 211 I 1 I I 1 1 1 1 1 11 1 1 1 1 nr 16 II 21 | 1 1, dice 2: 3 61 T 1 | | 1 11 T 1 16 | 1 21 26 | I 31 | I 16 36 | I 41 1 T 1 7 1 1 12 I 1 17 I T T 22 I 77 T 1 1 17 211 7 I I 12 T I 22 T I 27 | I 32 | I 37 1 42 T 17 1 I I 311 1 81 9- You will need to update the board as well, and display it after each round. It will be easier to create a function to display the board updated after each round. (Look for AI1,AI2) 13 I 20 18 | | 23 | | I 1 1 31 1 81 49 | 13 I 1 18 I 1 23 I I 28 | | 33 I 38 I 1 43 I 1 | AI1 11 I I I 14 I I 9 19 I 24 an I I AIl | | 9 I 14 T 1 19 II 24 I 1 AI2 1 29 | I I 39 I 44 I 1 1 I 5 1 10- Need to define all the above functions. 11- Need to validate user inputs. 12- Need to have the option of asking user if he/she wants to play again. 10 I 15 T 20 I 25 I 70 I 51 10 15 1 20 1 25 1 30 1 35 I I 40 45 50 I I I You are asked to implement Chutes and ladder game, but with specific rules. You MUST use functions to implement your code. Game rules: 1- We will use two dices, each will be generated randomly (1-6 included). 2- In this game, we will have two Al players. 3- At each round, each player will roll the dices once. 4- Target is whoever reaches 100 or above first win. 5- Chutes rules: a. If a player stands on "14" needs to move back to "2" b. If a player stands on "99" needs to move back to "50" 6- Ladder rules: a. If a player stands on "8" needs to move to "34" b. If a player stands on "20"needs to move to "90"] Implementation: 1- Display a message to the user, with the name and the rules of the game Welcome to snack and ladder We have two players, Both are AI players First one to reach 100 or above is the winner 2- Display the board game to the screen as well. (you can create your own design, below is a sample, the board should end at 100) Lets play: 1 I I 1 1 1 11 75 16 | I T 21 I I I 46 I 26 I 1 51 I 31 | I 36 I 1 41 I I I I 71 56 | 1 61 | 1 66 I 1 21 71 12 1 I 17 I 1 22 II 27 I I 32 1 1 42 1 1 37 1 1 1 I 47 52 1 I 57 | 1 62 1 I 67 1 1 72 1 A 3 T I 8 I 13 18 1 23 I 43 48 1 28 I | 53 33 | | 38 1 1 63 68 73 I I T 58 | I I I 1 T I 1 | T 1 1 1 1 9 I I 1 14 T 1 19 I T 24 | I 1 included). "See if you need to pass parameters" 29 1 34 1 39 44 49 54 I 1 59 | I 64 | I 69 1 71 I 5 I 10 15 20 25 30 35 45 50 60 I 40 I 65 1 I 75 1 1 55 1 I I I 1 70 1 3- rand_dice() function: This function will be used to roll the dice randomly (1-6 both 4- roll_chutes() function: This function will be used to update the value of player depending on the rules of chutes. "See if you need to pass parameters" 5- roll ladder() function: This function will be used to update the value of player depending on the rules of ladder. "See if you need to pass parameters" 6- players() function: This function will be used to call the above functions, where you need to roll the dices, check if you need to update the values depending on chutes or ladder? "See if you need to pass parameters" 7- play() function: This function is your important one, as you need to define your players and start the game rounds and announce the winner (player reaches 100 or above first) 8- Below is a sample output: Let's start Round: 1 Player 1 turn: Rolling the dice You got dicel: 1 Total moves: 4 Round: 1 Player 2 turn: Rolling the dice You got dicel: 3, dice 2: 5 **YOU ARE LUCKY** Total moves: 34 I 1 | | 211 I 1 I I 1 1 1 1 1 11 1 1 1 1 nr 16 II 21 | 1 1, dice 2: 3 61 T 1 | | 1 11 T 1 16 | 1 21 26 | I 31 | I 16 36 | I 41 1 T 1 7 1 1 12 I 1 17 I T T 22 I 77 T 1 1 17 211 7 I I 12 T I 22 T I 27 | I 32 | I 37 1 42 T 17 1 I I 311 1 81 9- You will need to update the board as well, and display it after each round. It will be easier to create a function to display the board updated after each round. (Look for AI1,AI2) 13 I 20 18 | | 23 | | I 1 1 31 1 81 49 | 13 I 1 18 I 1 23 I I 28 | | 33 I 38 I 1 43 I 1 | AI1 11 I I I 14 I I 9 19 I 24 an I I AIl | | 9 I 14 T 1 19 II 24 I 1 AI2 1 29 | I I 39 I 44 I 1 1 I 5 1 10- Need to define all the above functions. 11- Need to validate user inputs. 12- Need to have the option of asking user if he/she wants to play again. 10 I 15 T 20 I 25 I 70 I 51 10 15 1 20 1 25 1 30 1 35 I I 40 45 50 I I I
Expert Answer:
Related Book For
Managerial Accounting
ISBN: 978-0077826482
3rd edition
Authors: Stacey Whitecotton, Robert Libby, Fred Phillips
Posted Date:
Students also viewed these programming questions
-
In each of the following questions, you are asked to compare two options with parameters as given. The risk-free interest rate for all cases should be assumed to be 6%. Assume the stocks on which...
-
In Exercises 21, you are asked to compare three data sets. (a) Without calculating, determine which data set has the greatest sample standard deviation and which has the least sample standard...
-
In Exercises 22, you are asked to compare three data sets. (a) Without calculating, determine which data set has the greatest sample standard deviation and which has the least sample standard...
-
Alderon Industries manufactures chemicals for various purposes. One process that Alderon uses produces SPL-3, a chemical used in swimming pools; PST-4, a chemical used in pesticides; and RJ-5, a...
-
Use the (a) Euler and (b) Heun (without iteration) methods to solve d2y/dt2 0.5t + y = 0 where y(0) = 2 and y(0) = 0. Solve from x = 0 to 4 using h = 0.1. Compare the methods by plotting the...
-
Week 4 ProjectRegression and Correlation Methods: Correlation, ANOVA, and Least Squares This is another way of assessing the possible association between a normally distributed variable y and a...
-
a. Apply the following data to evaluate the time-based model of security for the XYZ Company. Does the XYZ Company satisfy the requirements of the time-based model of security? Why? Estimated time...
-
Fabila Company specializes in manufacturing a unique model of bicycle helmet. The model is well accepted by consumers, and the company has enough orders to keep the factory production at 10,000...
-
Hugo incurred $200,000 of federal student loan debt while attending college to become a teacher. His loan agreement states that his debt will be completely discharged if he is employed in a...
-
Red's Furniture Manufacturing produces a line of tables and chairs from specialty hardwoods. It makes three different styles of chairs, and each chair takes about the same amount of direct labour...
-
name at least two competitive advantages that are guarantees of success.
-
Q1: Identify and briefly describe three (3) main legislative requirements relevant to workplace communication (approximately 25 words for each). Q2: List the at least seven (7) key organisational...
-
Following are preacquisition financial balances for Padre Company and Sol Company as of December 31. Also Included are fair values for Sol Company accounts. Cash Receivables Sol Company Padre Company...
-
nces Required information [The following information applies to the questions displayed below] The balance sheets for Federer Sports Apparel for 2025 and 2024 are presented below. 2. Prepare a...
-
Windsor, Inc. reports net sales of $706,000, gross profit of $494,000, and net income of $230.000. What are its operating expenses? Operating Expenses $
-
* Find the angle in degrees of vector C counterclockwise from +x-axis, where C=3.00 A-4.00 B 30.0 B (2.40 m) A (3.60 m) 70.0 X
-
3. Considering the case where one of the Cs+ ions is missing, what is the magnitude of the net electrostatic force exerted on the CI ion in this case? 4. Find the magnitude of the gravitational force...
-
Provide an example of an aggressive accounting practice. Why is this practice aggressive?
-
Why are businesses starting to incorporate sustainability into their business model?
-
Access and download the 2013 annual report for The Home Depot or from the Connect library and compute the following ratios for The Home Depot's year ended February 2, 2014: fixed asset turnover, days...
-
Citco Company is considering investing up to $500,000 in a sustainability-enhancing project. Its managers have narrowed their choices to three potential projects. Project A would redesign the...
-
In what ways can management empower employees? What are the advantages of empowering employees?
-
Application of data analytics Indicate which type of data analytics, 1 through 4, is described in each of the following statements describing a data analytics application, \(a\) through \(h\). Data...
-
Access the Institute of Management Accountant's report titled "The Data Analytics Implementation Journey in Business and Finance," (https://www.imanet.org/...
Study smarter with the SolutionInn App