You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mitappinv...@googlegroups.com
I am making a quiz that selects random questions from a list. How would I stop it selecting the same question in the list more than once in the random process please?
Hal Abelson
unread,
Dec 23, 2013, 1:23:54 PM12/23/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mitappinv...@googlegroups.com
I assume you are using pick random element to pick from the list.
If you don't want to generate the same sequence of random numbers each time, you need to set the seed for the random number generator (set random seed). Of course, you need to arrange to not set that seed to the same value each time.
Taifun
unread,
Dec 23, 2013, 1:39:24 PM12/23/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mitappinv...@googlegroups.com
instead of using the pick a random item block use the following logic:
1. use the random integer block to get a random list index between 1 and the length of your working list
2. use the select list item block to select that item
3. remove the item from the working list with the remove list item block