subject

In the game dungeons & dragons, each player plays the role of a fantasy character.
a player performs actions by rolling a 20-sided die, adding a "modifier" number to the roll, and comparing the total to a threshold for success. the modifier depends on her character's competence in performing the action.
for example, suppose alice's character, a barbarian warrior named roga, is trying to knock down a heavy door. she rolls a 20-sided die, adds a modifier of 11 to the result (because her character is good at knocking downdoors), and succeeds if the total is greater than 15.
write code that simulates that procedure. compute three values:
the result of alice's roll(roll_result), the result of her roll plus roga's modifier (modified_result), and a boolean value indicatingwhether the action succeeded (action_succeeded). do not fill in any of the results manually; the entire simulation should happen in code.
hint: a roll of a 20-sided die is a number chosen uniformly from the array make_array(1, 2, 3, 4, 20). so a roll of a 20-sided die plus 11is a number chosen uniformly from that array, plus 11.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
The great length of north america causes the climate to be varied. true false
Answers: 2
question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
You know the right answer?
In the game dungeons & dragons, each player plays the role of a fantasy character.
a pla...
Questions
question
Mathematics, 28.09.2020 14:01
question
Chemistry, 28.09.2020 14:01
question
Mathematics, 28.09.2020 14:01
question
English, 28.09.2020 14:01
question
Geography, 28.09.2020 14:01
question
Mathematics, 28.09.2020 14:01
question
Mathematics, 28.09.2020 14:01
Questions on the website: 13722367