pif_RandomNumber

by Popisfizzy
This is a pseudo-random number generator that will produce the same numbers in a sequence for the same seed and bounds on any system.
ID:128523
 
This library is used to create an instance of a random number generator. Unlike BYOND's built-in generator (actually, the standard C/C++ pseudorandom number generator), this one is platform independent and consistent. This means that given the same seed and the same series of calls, the PRNGs will produce the same numbers each time, which can be useful for certain applications.

As I find myself being able to implement new PRNGs, I will update the library. One generator that I really want to implement in the Mersenne Twister, but my attempt at modifying a 16-bit implementation was a
miserable failure. If you find implementations of different PRNGs that will work on BYOND, please submit your source (preferably with some sort of code) to the forums.




Versions:
Version 2.01 (February 28, 2008):
  • New version released.
  • Removed old /random object.
  • Implemented the linear congruential method generator.

    Version 1.02 (April 15, 2007):
  • One more alteration to attempt to make good distribution.

    Version 1.01 (April 15, 2007):
  • Made the distribution a fair amount better

    Version 1.00 (April 15, 2007):
  • Released




Thanks goes to Hulio-G for the awesome hub icon.