Simulate a two player snake board game as shown in Figure 1 below. 26 27 29...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Simulate a two player snake board game as shown in Figure 1 below. 26 27 29 25 28 30 24 23 21 19 20 14 15 16 18 13 17 12 b. 87 10 2 3 6. "5 Figure 1: Snake board game You are required to do the following: 1. Create a snake board of size M rows and N columns. As C++ is a row major language, game will start at [M-1][0] and end at [0][N-1] (for odd M) or at [0][0] (for even M). 2. Randomly generate N-1 snakes on the board. In order to generate snake you only need to know head and tail of the snake. Make sure that both head and tail are on the board. Moreover, if head is on row (M:) and tail is on row (M;) then i will always be less than j. 3. Similarly, generate N-1 ladders on the board. 4. In order to start both the player need a six on the dice. Once the game is started display the output on the dice and wait for key press (you can use getch()) before second player's turn. 5. Game will go on until one player wins the game. 6. In case player lands on a snake's head it will come down to its tail, here you need to display a message "oops, snake got you!!!" 7. In case player lands on the bottom of the ladder it will climb the ladder, here you need to display a message "you got lucky" Note: Input validation is mandatory when reading taking input size of the board. Lands on snake's head / lands on bottom of the ladder: The term "lands on" means the final position of each player after each turn. So crossing a snake's head or bottom of ladder does not mean that you have landed. Simulate a two player snake board game as shown in Figure 1 below. 26 27 29 25 28 30 24 23 21 19 20 14 15 16 18 13 17 12 b. 87 10 2 3 6. "5 Figure 1: Snake board game You are required to do the following: 1. Create a snake board of size M rows and N columns. As C++ is a row major language, game will start at [M-1][0] and end at [0][N-1] (for odd M) or at [0][0] (for even M). 2. Randomly generate N-1 snakes on the board. In order to generate snake you only need to know head and tail of the snake. Make sure that both head and tail are on the board. Moreover, if head is on row (M:) and tail is on row (M;) then i will always be less than j. 3. Similarly, generate N-1 ladders on the board. 4. In order to start both the player need a six on the dice. Once the game is started display the output on the dice and wait for key press (you can use getch()) before second player's turn. 5. Game will go on until one player wins the game. 6. In case player lands on a snake's head it will come down to its tail, here you need to display a message "oops, snake got you!!!" 7. In case player lands on the bottom of the ladder it will climb the ladder, here you need to display a message "you got lucky" Note: Input validation is mandatory when reading taking input size of the board. Lands on snake's head / lands on bottom of the ladder: The term "lands on" means the final position of each player after each turn. So crossing a snake's head or bottom of ladder does not mean that you have landed.
Expert Answer:
Answer rating: 100% (QA)
C program to find minimum number of dice throws required to reach last cell from first cell of a giv... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
For this assignment, you are required to do the following: 1. Select the field of study that you are interested in. State clearly the Research topic. In the selected field of study, make sure that...
-
Two parts are assembled as shown in Figure 6.28. Assume that the dimensions x and y are normally distributed with means ïx and ïy and standard deviations ï³x and...
-
Two blocks, as shown in Figure P10.71, are connected by a string of negligible mass passing over a pulley of radius 0.250 m and moment of inertia I. The block on the frictionless incline is moving up...
-
The rigid bars ABC and CD are supported by pins at A and D and by a steel rod at B. There is a roller connection between the bars at C. Compute the vertical displacement of point C caused by the...
-
Slopes, Inc., manufactures and sells snowboards. Slopes manufactures a single model, the Pipex. In the summer of 2006, Slopes's management accountant gathered the following data to prepare budgets...
-
Agents and employees of Apples Corporation and Oranges Corporation are convicted of conspiring to violate a federal law that is punishable by a term of imprisonment and a fine. Can the corporations...
-
Use the Hubble expansion relation (9.1.1), the temperature scaling relation (9.1.3), and the energy density relation before the electron-positron annihilation (9.3.6b) to show that the temperature as...
-
Accounting for R&D Costs Margaret Avery Company from time to time embarks on a research program when a special project seems to offer possibilities. In 2009 the company expends $325,000 on a research...
-
BHT Company evaluates a project for a potential inclusion in its capital budget. In the first year of the project, it expects incremental net income of $33 million, depreciation expenses of $8...
-
Southeastern Foods has hired you to analyze their distribution-system design. The company has 11 distribution centers, with monthly volumes as listed below. Seven of these sites can support...
-
Write a function get_parallelogram_area (base, height) which takes a base and height of a parallelogram as parameters, and returns the area (i.e. base height) of the parallelogram rounded to the...
-
What Went Wrong Here (And How Can We Address It With Research)?Imagine that you are on the board of directors for a company that was debating whether to recall its staff back to the office following...
-
National Tutoring Association description of services provided, costs, hours of operation and a URL or other method parents can access this information.
-
In estimating bad debt expenses, we can use deductive reasoning by looking at historical collection patterns
-
What environmental changes enabled Netflix to successfully innovate in the home video market? How do you assess Netflix's decision to produce their own content?
-
Your insightful post on integrating sustainability into capital budget planning has sparked my interest, especially considering its relevance in today's corporate landscape. I'm curious about the...
-
Industrial Incorporated has the following account balances: COGS = 4,000; Depreciation = 500; Interest = 250; rent = 1,000; Salaries = 3,000; Sales = 10,000, Taxes 350. Industrial Incorporated's...
-
Privitera and Freeman (2012) constructed a scale to measure or estimate the daily fat intake of participants; the scale was called the estimated daily intake scale for fat (EDIS-F). To validate the...
-
Let S1 and S2 be disjoint laminas in the xy-plane of mass m1 and m2 with centers of mass (x1, y1) and (x2, y2). Show that the center of mass (x, y) of the combined lamina S1 ( S2 satisfies with a...
-
Suppose that the surface S is determined by the formula z = g (x, y). Show that the surface integral in Stokes's Theorem can be written as a double integral in the following way: Where n is the...
-
A wheel centered at the origin and of radius 10 centimeters is rotating counterclockwise at a rate of 4 revolutions per seconds. A point P on the rim is at (10, 0) at t = 0. (a) What are the...
-
Macquarie Manufacturing Ltd prepared the following planned production data for the forthcoming year ending 30 June 2019. Required (a) Prepare a table showing the predetermined factory overhead rate...
-
Beautiful Bottles Pty Ltd, bottle manufacturer for the food industry, has just installed a job order costing system. The company uses machine hours to apply its overhead to work in process. On 1 May...
-
Green Consultants Pty Ltd specialise in consulting on landscape design. The company developed a predetermined charge-out rate based on hours for each of its consultants on 1 July 2019 to assign the...
Study smarter with the SolutionInn App