Went looking for a best of breed RANDOM number generator and so far was unable to find one that is really all that close to being random on a fast computer.

So here is the challenge.
Write a RANDOMIZE function that supports the following criteria

  • 1. Must be able to handle a MIN/MAX input range
  • 2. Must support both whole and decimal numbers
  • 3. Must not readily (obviously detectable pattern) duplicate numbers in successive calls including small range of 1-10
  • 4. Must support calls similar to this
    Random(0.000, 0.999)
    Random(1, 5)
    Random(500, 10000)
  • 5. Use of seed or method to ensure randomness should be controlled by the UDF
  • Example:
    For $ = 1 To 50
       Random(0.000, 0.999) ?
    Next
  • 6. Must support Explicit and NoVarsInStrings just like all other UDFs


Here is an example Random method from a mini putt challenge Kixtart Mini-putt challenge for tonight

This challenge does not have the same restrictions though as that one did, this is not a Golf challenge but rather a UDF Challenge.

Though a number after a number may still be random it is not if success calls show a simlar duplicate pattern

Example of duplicate
  • 1
    4
    6
    6
    8
    9


Though the 6 after the 6 may be random it is not if you call the function 10 times and you see values that repeat in a pattern.