Math, asked by jaindrasingh3734, 1 year ago

how to generate a random number between 0 and 19 in c++

Answers

Answered by himanshusingh52
3
am making a text-based C++ RPG and I am trying to figure out how to work out the amount of damage that the enemy hits you for. My idea is something like this.

Damage done = randomIntBetween10and20*enemyLevel

This way it doesn't always hit for a set amount each time and allows there to be Critical Strikes(For example, if the hit is above 15 I would class that as a Critical Strike)

I'm new to C++ so I'm not quite sure how I can do this, any help would be greatly appreciated.

Similar questions