Reference no: EM13308487
I have been trying for days to figure out how to get this working, but have yet to succeed in doing so. Can some please help me with this?
Repeatable steps start here
Let the player indicate his level, the monster level and any enhancements on his weapon or spells.
Generate a random number for the user and for the monster as an integer number between 1 and 500.
Monsters can be up to 5 levels above or below the player. For every level the monster is below the player level, add 10 from the player's roll. And for every level the monster is above the player's level, add 5 to the monster's roll.
Players can have enhanced weapons and spells. For an enhanced weapon, add 10 to the player roll. For an enhanced spell add 5 to player roll.
If after evaluation there is a tie re-evaluate with two new random numbers, but the player loses his weapon enhancement in the subsequent roll. The level differential remains in effect and the spell enhancement remains in place.
Display each encounter's result, including monster level, player level, enhancements, monster score and player's modified score.
Repeatable steps should end here.
To quit have the player enter a 0 for player level. That is, repeat the above steps until the user says that he is finished by entering a 0 for the next player number. Note you should only have to seed the random number generator once.
When the user indicates that he is finished, display the results, including the number of monsters faced, number of monsters killed and the subsequent kill ratio (number of kills/ number of encounters).