Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The TikTok is Not Real Life Company has decided to hire you to improve their board game simulator for the game Chutes & Ladders. The

The TikTok is Not Real Life Company has decided to hire you to improve their board game simulator for the game "Chutes & Ladders". The board has squares which are numbered from 1 to 100 and players have counters which start on the theoretical square 0. The players take turns at spinning a spinner with the numbers 1 to 6 on it, and each moves his or her counter forward the number of squares corresponding to the number on the spinner. The first person to reach square 100 is the winner.
The interest is caused by the fact that pairs of squares are connected together by "ladders" (which connect a lower-numbered square to a higher-numbered square) and "chutes" (which run from high to low). If a counter lands on the start of a chute or ladder the counter is moved to the corresponding square at the end of the chute or ladder. Note that landing on the end square of a ladder or a chute has no effect, only the start square counts. If a player is on square 95 or higher, then a spin which takes them past 100 must be ignored - thus a player on square 99 must ignore all spins which are not 1.
In C++, using classes and arrays of classes:
Create a Chutes & Ladders game for two (2) to six (6) players, allow the users to play as many games as they wish, either with the same players or new ones
Use two classes:
The game: stores information about the board (in an array); methods include a constructor (sets up all the chutes & ladders values), a turn method (requires a player), a spin method (returns a random number from 1 to 6), and a winner method (returns a bool indicating whether this player has won or not)
The player: stores information about the player; methods include all relevant accessor and mutator methods. Track how many chutes or ladders the player has reached while playing the game. Output this information for the winner.
Main will request the number of players and get the names for that number of players. Be sure to restrict the number of players to a number from two (2) to six (6). Main will determine who goes first and turns continue in round-robin fashion after that.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions