Hi
i think a good start will be knowing the basic Rnd commands and how to make a selection of numbers.
To make a random playing card:
Lets say you want to select 16 random numbers from 1 to 99 without repeating any. this code will help you put them in an array:
- sub RNumbers()
-
dim i as integer
-
dim j as integer
-
dim Boo1 as boolean
-
dim Array(1 to 16) as integer
-
array(1) = int(rnd * 99 +1)
-
i= 2
-
do
-
array(i) = int(rnd * 99 +1)
-
boo1=false
-
for j = 1 to i-1
-
if array(j) = array(i) then boo1=true
-
next
-
if boo1=false then i = i+1
-
if i = 17 then exit do
-
loop
-
end sub
after that, you can just have a thing making random numbers that havent been used before. its almost the same code.
Good Luck
yea man that what im looking for but
how to make it check the list1.additem label1.caption
label1.caption = int(rnd*100)+1
list1.additem label1.caption
now the question is where do i put the anti-repeat
what i want is:
the number from label1.caption will be recorded into list1.additem
now that numbers are in the list1.additem thingy
how to make it check number in the list1.additem thingy.
or any alternative option to store the numbers in a visual form but checks the number if existed it change another number and so on.
if any1 dont understand i'll post a GUI draft.