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:
[CODE=vb]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[/CODE]
after that, you can just have a thing making random numbers that havent been used before. its almost the same code.
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:
[CODE=vb]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[/CODE]
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.
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.
yeap, save them into an array, listbox, or wherever you want, check out the code i've posted before, it does exactly what you want, just that im not saving the numbers into a list, but into an array. The code should be almost the same.
i want to make a bingo game on vb6 and dont really know which codes to use
any1 gimme some ideas?
Hi
If you are serious in making of gamr then i will with you for this purpose. Reply me. My plus point is that i m good designer and can create my own images.
Comment