Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Quiz Script
- Divya51
-
1 post
Quiz Script
hey … i am making a quiz game … i want questions to be random as well as they should not repeat in a cycle of series of wrong answers ?
how to code the script for this ??
how to code the script for this ??
- deck26
-
1000+ posts
Quiz Script
If you want to select questions in a random order an easy method is to store the questions and answers in lists so that answer 3 corresponds to question 3.
Then create another list from 1 to N where N is the number of questions you have. Now shuffle that list - eg by going through the list in a loop and swapping each item with another random item. That will give you the numbers 1 to N in a random order and you can use that list to select the questions and answers.
Then create another list from 1 to N where N is the number of questions you have. Now shuffle that list - eg by going through the list in a loop and swapping each item with another random item. That will give you the numbers 1 to N in a random order and you can use that list to select the questions and answers.
- Discussion Forums
- » Help with Scripts
-
» Quiz Script