So I found this question I was asked this evening interesting. I was told to, very quickly obviously, make a quick tool that generate a random integer. Easy right? But wait! I suppose there is a twist... This is going to be choosing a winner for a grand price. A grand price grand enough that I wish I could win, but for disclosure I can not say much more Lol. So, I was wondering if there are any legals involved when choosing a "random" winner. In all honesty I feel any computational piece of data a computer generates is never really random, so whats second best?
The only way I know of doing such a task is purely basic at best.
vbnet Code:
Public Class Class1
Private rnd As New System.Random(DateTime.Now.Millisecond)
Public Function GenerateRandomInteger(ByVal Minimum As Integer, ByVal Maximum Integer) As Integer
Return rnd.Next(Minimum, Maximum)
End Function
End Class
To get crazy, can we do unique ways of using random.next() to produce a more promising result?
vbnet Code:
Public Class Class1
Private rnd As New System.Random(DateTime.Now.Millisecond)
Public Function GenerateRandomInteger(ByVal Minimum As Integer, ByVal Maximum Integer) As Integer
Dim col As New System.List(Of Integer)
Dim c As Integer = 0
Dim i As Integer = 0
Dim r As Integer = 0
c = rnd.Next(0, 999)
i = rnd.Next(0, 999)
Do
col.Add(rnd.Next(Minimum, Maximum))
While (col.Count < c)
r = col(i)
Return r
End Function
End Class
Idk, this is a rather unusual topic for me to ask, but in business development. I find using random numbers nonexistent.
PS I'm not going to use Random.Org