|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.Dice
A class to generate random numbers of various sorts. d() is a n-sided die numbered 0 to n-1. This is the most common use of this class.
| Constructor Summary | |
Dice(int si)
Make a die with this many number of sides. |
|
| Method Summary | |
static boolean |
coin()
|
static boolean |
coin(float per)
An unfair coin. |
static int |
d(int what)
Return number from 0 to what-1, inclusive (i.e. [0, what) |
static double |
f(double max)
Return double from 0 to max. |
static double |
f(double min,
double max)
Return double from min to max. |
static float |
f(float max)
Return float from 0 to max. |
static float |
f(float min,
float max)
Return float from min to max. |
static void |
main(String[] args)
|
static boolean |
percent(float per)
Have a per chance of returning true. |
static void |
reset()
|
int |
roll()
Return a number between 0 and the number of sides of the die minus one. |
static void |
setSeed(long val)
|
static long |
setSeedLock()
Reset random number generator and returned the used seed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Dice(int si)
| Method Detail |
public int roll()
public static int d(int what)
public static boolean coin()
public static boolean coin(float per)
per - Chance of true. In [0,1].public static boolean percent(float per)
per - Percent, in [0,1] (i.e. expressed as decimal.)public static float f(float max)
public static float f(float min,
float max)
public static double f(double max)
public static double f(double min,
double max)
public static long setSeedLock()
public static void reset()
public static void setSeed(long val)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||