Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need some help with an assignment for an LCR game in C++ as I'm not sure how to go about it. The only file

I need some help with an assignment for an LCR game in C++ as I'm not sure how to go about it. The only file I have is the rules that need to be displayed. Aside from entering the number of players, there should be no other input required from the user (no player names and the dice rolls should happen automatically).

Develop a program that follows the rules of Left Center Right (LCR) as described. On program start-up, it shall display the rules to the user as read from a text file submitted with the program. The user can then set up the game by entering the number of players. Any number below three shall ask the user to add more players. Once game play has started based on the game rules, there are a few main pieces to address. Rolling the die should be performed by randomly generating the side of the die displayed for each of the three using a random number generator. For this game, if the generated number is 1, that will be L. Additionally, 2 is R, 3 is C, and 46 are dots that can be represented with the asterisk symbol *. Be sure to check the current players number of chips before rolling. After each players roll, calculate the number of chips for players based on the actions dictated by the dice. Continue playing until only one player has chips. Display a message to the game winner. Left Center Right (LCR) is a multiplayer dice game with a minimum of three players, but no upper limit on the number of participants. The goal is to win all of the chips.

The Dice

There are three dice rolled each turn. Each die has the letters L, C, and R on it along with dots on the remaining three sides. These dice determine where the players chips will go.

For each L, the player must pass one chip to the player sitting to the left.

For each R, the player must pass one chip to the player sitting to the right.

For each C, the player must place one chip into the center pot and those chips are now out of play.

Dots are neutral and require no action to be taken for that die.

The Chips

Each player will start with three chips.

If a player only has one chip, he/she rolls only one die. If a player has two chips left, he/she rolls two dice. Once a player is out of chips, he/she is still in the game (as he/she may get chips passed to him/her), but passes the dice to the next player. Winning the Game

The winner is the last player with chips.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions