Question: fill in the code please: Write code that simulates the above process: Roll a 2 0 sided die Add a modifier of + 1 1
fill in the code please: Write code that simulates the above process:
Roll a sided die
Add a modifier of
Check if the combined roll succeeds roll modifier
In other words, compute three values: the result of Alice's roll rollresult the result of her roll plus Roga's modifier modifiedresult and a boolean value indicating whether the action succeeded actionsucceeded Do not fill in any of the results manually; the entire simulation should happen in code. Hint: A roll of a sided die is a number chosen uniformly from the array makearray So a roll of a sided die plus is a number chosen uniformly from that array, plus
:
possiblerolls
rollresult
modifiedresult
actionsucceeded
# The next line just prints out your results in a nice way
# once you're done. You can delete it if you want.
printfOn a modified roll of modifiedresult Alice's action succeeded if actionsucceeded else 'failed'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
