
-----------------------------------
Wintermini
Tue Jan 12, 2010 6:33 pm

When randomizing numbers, how do I prevent the number to reoccur?
-----------------------------------
What is it you are trying to achieve?
I'm trying to create a quiz :) I got the randomizing questions part with the help of arrays, but sometimes, the question will repeat itself. I don't want that.


What is the problem you are having?
- questions (or numbers either way...) are repeated -__-
- how do i calculate the score for this quiz as well?
- how do I stop this quiz?!?! T_T omg i'm so lost and helpless :cry:


Describe what you have tried to solve this problem
I tried to take out the looping process out of the code, but I don't think it's helping :\


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)


var q : array 0 .. 5 of int

q(0) := Pic.FileNew("q3.bmp")
q(1) := Pic.FileNew("q4.bmp")
q(2) := Pic.FileNew("q6.bmp")
q(3) := Pic.FileNew("q7.bmp")
q(4) := Pic.FileNew("q8.bmp")
q(5) := Pic.FileNew("q9.bmp")
if x >= 450 and x = 400 and y = 300 and x = 200 and y = 300 and x = 200 and y = 300 and x = 200 and y = 310 and x = 270 and y = 310 and x = 270 and y = 310 and x = 270 and y = 300 and x = 350 and y = 300 and x = 350 and y = 300 and x = 350 and y = 280 and x = 420 and y = 280 and x = 420 and y = 280 and x = 420 and y = 300 and x = 350 and y = 300 and x = 350 and y = 300 and x = 350 and y = 285 and x = 200 and y = 285 and x = 200 and y = 285 and x = 200 and y 