umm!, what you need to know is that rnd gives a number from zero to the number you give it, so to get a random number between one and 48 you need to do
number=rnd(47)+1 <<<< note that +1...it`s important
so the highest number you can get is 47, and 47+1=48, likewise the lowest number you can get is 0, and 0+1=1, so that solves that problem.
your second problem is that you don`t want any of the numbers to repeat, you can do this in two ways, firstly, you can chose a number and check to make sure it isn`t already picked, for that you need to remember the last numbers you picked and compare them all with the number you already have, and only pick the next number when they all have been checked and passed the test.
the other way is to have an array of numbers from 1 to 48, so that
number(1)=1
number(2)=2
etc
.
.
number(48)=48
then shuffle all the numbers in the 48 locations by chosing two at random, then swapping the numbers over, so that after a few thousand swaps the array looks something like
number(1)=17
number(2)=35
etc
.
.
number(48)=2
once you have them all at random then you can just pick the first numbers, since they where all just shuffled and not copied, you won`t get any duplicates, you can shuffle the values like this
dim Number(48)
for i=1 to 48
Number(i)=i
next i
for i=1 to 1000
Location_1=(rnd(47))+1
Location_2=(rnd(47))+1
Temp=Number(Location_1)
Number(Location_1)=Number(Location_2)
Number(Location_2)=Temp
next i
print "after shuffle (note no repetitions)"
for i=1 to 48
print "location ";i;" = ";Number(i)
next i
do
loop
will create 48 numbers and shuffle them for you, you don`t even need to check for the swap numbers being the same since all that does is leave a number where it is (it swaps it with it`self), hope thats some help to you.
Mentor.
PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.