Random numbers aren't the size I want them
I'm using the fuction below and I can't figure out when I used dice(6); why it produces numbers larger then 6. The function below that one is the function I am using and the results are under the code.
Code:
short int dice(int size) Dexterity : 24 Charisma : 18 Intelligence : 25 Wisdom : 28 Constitution : 30 |
You should use = instead of +=. Or else set the stats of ch to 0 before calling dice_attributes().
Also, the - 1 + 1 in dice is redundant. |
Your size mod expression is probably not what you intend (size -1 +1), maybe a typo?
The value in ch is not necessarily zero, so explicitly set it to zero first, or better yet, use = instead of += in those lines. Dang! ntubski was faster on the submit! ;) |
Then I realize I was testing my back input and I kept adding things to my stats because of the += thanks very much!
|
All times are GMT -5. The time now is 11:46 PM. |