Results 1 to 1 of 1
Thread: Java compatible RNG algorithm
2011-03-24, 17:42 #1
- Join Date
- Dec 2009
- Ohio, USA
- Thanked 0 Times in 0 Posts
Java compatible RNG algorithm
I'm looking for an algorithm for a Random Number Generator for a Java project. I don't necessarily need code (though it would make my job easier) it just needs to be compatible.
Java does of course have it's own RNG (math.random()) but I was hoping to make my own. I haven't decided on a seed yet so it doesn't really matter if the algorithm comes with a specific one in mind so long as the seed value doesn't have a limit (the standard seed in Java's RNG is the number of milliseconds since 1970). The output needs to be in the range of 0 to 1 not including 0 or 1 (this way I can just plug and play between the standard Java RNG and another).
For clarity: Java doesn't really support uint (unsigned intergers or the like). So, this has to work without relying on unsigned values (like all the others I've found).
For the seed I'm planning to combine some value from the system (like the time thing) with a number supplied by the end user. A debug module could of course remove the system induced number for predictable results.Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]