hey all,
i want u to test the Active X exe which uses the algorithm of giving out perfectly random nos in a set. u can dload it from my
homepage
|
|
Printable View
hey all,
i want u to test the Active X exe which uses the algorithm of giving out perfectly random nos in a set. u can dload it from my
homepage
|
|
...how does it work then?
Sorry for low documentation sense.
here is how u do it:u create an object of the Randgen class after setting a reference to the Randset.exe in ur prj.then call its fn
getall(lim as int) which returns the random set.
& here is how it works(this is only the code for the fn) :-
public function getall(lim as integer) as integer()
Dim arr(lim) As Integer
Dim i As Integer
Dim j As Integer
Dim num As Integer
Randomize
arr(i) = Rnd * 10 \ 1
i = i + 1
Do While i <= lim
seed: num = Rnd * 10 \ 1
For j = 0 To i - 1
If num = arr(i) Then GoTo seed
Next
arr(i) = num
If i = lim Then Exit Do else i=i+1
Loop
getall=arr()
End Sub