Question: In C + + : In Dungeons and Dragons, there are a lot of methods to roll up the ability scores for characters, which are

In C++: In Dungeons and Dragons, there are a lot of methods to roll up the ability scores for characters, which are numerical measures of the physical/mental/social characteristics of a person (typically between 3-18) and measure things like their strength, dexterity, intelligence, charisma, etc. You're task is going to be to write up a code that uses the "4d6" method.
The "4d6" method involves rolling 4 six-sided dice. You then drop the lowest die roll, and add up the remainder. For example:
rolls of 1,1,4,5=10
rolls of 3,4,5,6=15
rolls of 5,5,6,6=17
Your task is to create a function that does this. We've done die-rolling in the past. You may copy and use that function in your lab, so I've included it here:
int rollDie(void){
return 1+ rand()%6;
}
You should have appropriate separation of function prototype and implementation. The user should have the option to roll again. Make it look pretty. Your program should tell the user what it is doing. Below is a good example.
This program generates ability scores for D&D characters using the 4d6 method.
Dice Rolls: 2,2,5,6
Lowest Die Dropped: 2
Ability Score =13
Would you like to roll again? Y or N:
If you play D&D and want to expand upon it, feel free to be creative!
Hint: Store the die rolls into variables. Then store the first roll into another variable called min. Then do so if-statements to see if any of the other dice are lower, and if so, replace min with the lower roll.

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 Databases Questions!