How can i randomly select from 1-10 with out repeating the same number in the process
-
is there any posible way to control the output of the codes "Math.floor(Math.random()*10+1)" as in everytime it generates a new number it wont generate the same number it previously have. like for example i use math random to generate a question out of 10 questions at first it pick the 3rd question now the next time it will generate another question it will not choose the 3d question again..
-
Hello,
This might help you: "Permutation":http://en.wikipedia.org/wiki/Permutation#Random_generation_of_permutations
-
Yes. You store indexes of your questions in an array. Than you just get questions[ ramdomized_indexes[ index ] ], where index increases from 0, when user answers a question. ramdomized_indexes is generated when application start.