Computer Science Canada random integers |
Author: | Prince [ Thu Feb 19, 2004 11:07 am ] |
Post subject: | random integers |
how do u get them? i had sum code but it disappeared ![]() |
Author: | wtd [ Thu Feb 19, 2004 7:18 pm ] | ||
Post subject: | |||
See the Sun Java docs for the Random class. |
Author: | Prince [ Fri Feb 20, 2004 10:18 am ] |
Post subject: | |
isnt there a simpler way ![]() |
Author: | Tony [ Fri Feb 20, 2004 2:12 pm ] | ||
Post subject: | |||
looks preaty simple to me... once you declear your randomNumGen, its just
|
Author: | rizzix [ Fri Feb 20, 2004 5:08 pm ] | ||
Post subject: | |||
even simpler? hmm...
|
Author: | wtd [ Fri Feb 20, 2004 6:18 pm ] | ||
Post subject: | |||
rizzix wrote: even simpler? hmm...
Yeah, I knew someone would beat me to that answer, so I posted the other answer. ![]() Really, though, use either one, but know the Random class. It's more powerful and flexible than Math.random(). |