Posted 08 July 2013 - 11:55 AM
when i looked at the math library tutorial, i was shocked of the effectiveness of math.random(), because math.random() is pseudo random, not truly random, ok, this API isn`t truly random either, but it`s very close to it,so i began to improve the PRNG (pseudo-random number generator) and this is the result.
features:
code:
http://pastebin.com/nZAfgJVk
usage:
1.pastebin get nZAfgJVk RandomNumber
2.os.loadAPI("RandomNumber")
3.????
4.PROFIT!!!
features:
Spoiler
RandomNumber.genNumber()--doesn`t accept an argument, generates a random number
RandomNumber.genBetween(min,max)--generates a random number, min is the minimal amount it needs to be, guess what`s max for? this returns 2 parameters: randomnumber, remainder (remainder of my algorithm)
code:
http://pastebin.com/nZAfgJVk
usage:
1.pastebin get nZAfgJVk RandomNumber
2.os.loadAPI("RandomNumber")
3.????
4.PROFIT!!!