I made this, because i thought i got better random numbers than ran, and dont say its not really random, because i know that
tell me if its better or worse or wahteverVB Code:
Private Declare Function GetTickCount& Lib "kernel32" () Private Sub Command1_Click() Call RealRand(1, 5000) 'change to lowerbound,upperbound End Sub Private Function RealRand(Lowb As Integer, upb As Integer) Randomize Dim t As Long Dim p As Integer t = GetTickCount Do Until t >= Lowb And t <= upb t = t / (Rnd * 100) DoEvents ' t = t / Int(upb - Lowb) * Rnd If t < Lowb Then t = upb * Rnd End If Loop MsgBox t End Function






Reply With Quote