|
A very simple script to
This JavaScript picks up a
This JavaScript, based on
display random banners and
number of unique random
Unique Random Numbers II,
links on your web site.
elements from an array. For
picks Unique Random Sets.
example; if you have an
Here, there are more than
array myArray consisting of
one arrays (need not be of
10 elements and want to pick
same length). First, we pick
5 unique random elements.
a number of unique random
Suppose initially myArray[3]
elements from the first
is picked randomly, then
array, numArr1 to form the
myArray[3] should not be
array pickArr1. Now each
picked again. If you want to
element of pickArr1 picks
pick 4 numbers, call the
another element from the
function like: pickNums(4).
second array numArr2, which
again is unique and random.
Thus we form the array
pickArr2. Similarly each
element of pickArr2 picks
unique random elements from
numArr3 to form pickArr3.
Date: Jul, 16 2001 Date: Jun, 24 2003 Date: Aug, 26 2002 |