How do i do that? As in randomizing order of words displayed from an array.
I'm building a quiz game, and thanks to the example given by procrastinator, I have made good progress, But I would like to randomize a the options of answers given, and how is it possible?
For example, after loading the file questions.txt using Ajax, the format i'm using in the file is question,ans1,ans2,ans3,ans4,ans5,correct answer index.
So the order the answers will be displayed in the answers box is by the order 1-5, the question is how to randomize it? I don't want them in the order 1,2,3,4,5; instead i want them to be randomly jumbled up, 2,1,4,5,3. How is it possible to do that?
If you're interested in why I need to do this, it is because I'm doing the game for revision and sometimes I've seen a certain question so many times I kinda remember the 'location' of the answer to that question without even needing to look at the answers or thinking. I want to avoid that, hence this.