Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private sub RandomGenerator(byval argGender as boolean)
- dim num as integer
- if argGender then
- num = malenames.length()
- else
- num = femalenames.length()
- end if
- dim x , mix , mix2,temp as integer
- dim randarray(num) as integer
- dim randnum as random = new random()
- for x = 0 to num step 1
- randarray(x) = x
- next x
- for x = 0 to num step 1
- mix = randnum.next(0,num)
- mix2 = randnum.next(0,num)
- temp = randarry(mix)
- randarry(mix) = randarray(mix2)
- randarray(mix2) = temp
- next x
- if argGender then
- for x = 0 to num step 1
- lstnames.items.add(malenames(randarry(x)))
- next x
- else
- for x = 0 to num step 1
- lstnames.items.add(femalenames(randarry(x)))
- next x
- end if
- end sub
Advertisement
Add Comment
Please, Sign In to add comment