Example usage:
// You can create multiple /nq_rand objects.
// This is useful if you want to provide your own
// seed values and don't want other code from
// interfering with your random number generation.
var/nq_rand/r = new
// Alternatively you can pre-initialize with a seed.
// This is for convenience; it just calls the
// r.Seed proc after creation.
// var/nq_rand/r = new(12345)
// You can modify the seed at any point.
// r.Seed(12345)
// Set the maximum amount of decimal points in the
// result. (Defaults to 5.)
r.MaxDecimals(0)
// Stores a random number between 1 and 5 (inclusive).
var/n = r.Random(1, 5)
Note that presently this algorithm is not faster than DM's built-in rand() proc but it is platform independent. It is intended to be used in situations where you want to store the seed value for later duplication of the same "random" values (e.x., random map generation).
As usual the source-code is available in my repository on Github. If you have any ways to improve any of my libraries feel free to let me know and I'll add it to a new release.