posted 13 years ago
Math.random() is a good place to start. If that doesn't suit your needs, then java.util.Random should be your next stop.
Math.random() generates a double between 0 and 1 (including 0, but not 1). As T Dahl suggested, you can multiply this value by some factor to increase your range, then shift that range by adding or subtracting.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org