Hi,
Is there a quicker way of doing this bit of code.want to roll 5x ten sided dice and add the results.The way i have done it looks nasty,
Do i have name each roll as a varible and then add the results?triedCode:int playerHealth=( (rand ()%10)+1)+( (rand ()%10)+1)+( (rand ()%10)+1)+( (rand ()%10)+1)+( (rand ()%10)+1);
but that only rolls once and multiplys it by 5.Code:int playerHealth=( (rand ()%10)+1)*5
any ideas?



LinkBack URL
About LinkBacks




- extreme' values would be more common, and the 'middle-road' values would occur less frequendly.. The distribution should be uneven (in theory) so that rolls with multiple die are typically biased towards the middle-road values.