Results 1 to 14 of 14

Thread: RealRand

Threaded View

  1. #1

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    RealRand

    I made this, because i thought i got better random numbers than ran, and dont say its not really random, because i know that

    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private Sub Command1_Click()
    4.    Call RealRand(1, 5000) 'change to lowerbound,upperbound
    5. End Sub
    6.  
    7. Private Function RealRand(Lowb As Integer, upb As Integer)
    8. Randomize
    9. Dim t As Long
    10. Dim p As Integer
    11. t = GetTickCount
    12.    Do Until t >= Lowb And t <= upb
    13.    t = t / (Rnd * 100)
    14.    DoEvents
    15.      '  t = t / Int(upb - Lowb) * Rnd
    16.         If t < Lowb Then
    17.               t = upb * Rnd
    18.         End If
    19.    Loop
    20.                 MsgBox t
    21. End Function
    tell me if its better or worse or wahtever
    Last edited by |2eM!x; May 25th, 2005 at 10:46 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width