Question: Stage 1 Create an array to store the player's dice rolled, i . e . the five dice values. For example: int p l a

Stage 1
Create an array to store the player's dice rolled, i.e. the five dice values. For example:
int playerdice [5]={0};
Add code to simulate the rolling of five dice, i.e the damage the player will do. That is, you should generate five random numbers, each in the range of 1 through 6(inclusive) and assign each number to an array element. Use the rand() function (i.e.1+rand()%6) to simulate the roll of a die. Hint: Use a loop in order to assign each random number (die roll) to an array element.
Display the player's dice (i.e. the randomly generated dice roll) to the screen, e.g.:Sample output (this will look different given we are generating random values here):Player rolled:
\table[[Die 1,Die 2,Die 3,Die 4,Die 5],[5,2,1,1,6
Stage 1 Create an array to store the player's

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!