Answered step by step
Verified Expert Solution
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 to and players have counters which start on the theoretical square The players take turns at spinning a spinner with the numbers to 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 is the winner.
The interest is caused by the fact that pairs of squares are connected together by "ladders" which connect a lowernumbered square to a highernumbered 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 or higher, then a spin which takes them past must be ignored thus a player on square must ignore all spins which are not
In C using classes and arrays of classes:
Create a Chutes & Ladders game for two to six 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 to 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 to six Main will determine who goes first and turns continue in roundrobin fashion after that.
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