question
question
(OP)
I have one question, first of akll I want to thanks to everyone who gives me advice for director.
Qustion is:
I hava database of 40 questions with a,b,c,d answer. How can I make randomize questions of 10 questions.
Thank you.
Qustion is:
I hava database of 40 questions with a,b,c,d answer. How can I make randomize questions of 10 questions.
Thank you.
RE: question
CODE
list40 = []
repeat with i = 1 to 40
list40.append(i)
end repeat
n = 40
repeat while n > 1
m = random(n)
tN = list40[n]
tM = list40[m]
list40[n] = tM
list40[m] = tN
n = n - 1
end repeat
list10 = []
repeat with i = 1 to 10
list10[i] = list40[i]
end repeat
return list10
end generate10randomNumFrom40
put generate10randomNumFrom40()
-- [29, 9, 32, 2, 1, 5, 23, 31, 21, 35]
put generate10randomNumFrom40()
-- [24, 28, 40, 21, 35, 20, 30, 11, 33, 18]
Kenneth Kawamoto
www.materiaprima.co.uk
RE: question
RE: question
Kenneth Kawamoto
www.materiaprima.co.uk