File: Util.em
Description: Utility functions
Last Modified: 6/15/2006
RandomDiceRoll(String dice_string) |
---|
Parameters: |
---|
Name | Type |
dice_string | String |
Explanation |
---|
Returns a random number according to the passed die roll string. This is standard NdS+X format. N=number of dies to roll, S=number of sides per die, X=integer to add(or subtract) after roll. |
Here's some acceptable examples:
|
4
d4
d6+6
d6-2
2d12
2d8+12
2d8-4
|
Return values |
---|
Valkyrie's pedantic wording: "returns an integer greater or equal to N+X and not more than N*S+X" |
RandomFloat(real below_this_number) |
---|
Parameters: |
---|
Name | Type |
below_this_number | Real |
Explanation |
---|
Returns a random real below the passed parameter and greater or equal to zero. |
Return values |
---|
Real R such that 0 less or equal to R less than below_this_number |
Errors |
---|
"RandomFloat() expects a Real parameter" |
RandomInt(integer below_this_number) |
---|
Parameters: |
---|
Name | Type |
below_this_number | Integer |
Explanation |
---|
Returns a random integer below the passed parameter and greater or equal to zero. |
Return values |
---|
Integer R such that 0 less or equal to R less than below_this_number |
Errors |
---|
"RandomInt() expects a positive integer" |
If you know if any information is incorrect on these pages, mail your corrections to shinigami@gmx.net
Copyright ©2003-2011 David Carpman and Shinigami, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.