hello,
can any one suggest a way of producing a set of 13 random numbers but without repeating any ?
trying to write a times table multiplication test
to go through the numbers 0 to 12 but in a random order but each number only once ?
thankyou
Offline
Try using a list, and deleting the item from the list whenever it is chosen.
Offline
many thanks will give it a try, what would that look like in a program ?
not sure how to delete from list
Offline
charles2004 wrote:
many thanks will give it a try, what would that look like in a program ?
not sure how to delete from list
Look around in the Variables section of the editor and you'll find the block you need to delete items from a list.
Offline
Try this script (you need three lists: one that has the numbers you want, and two empty; and two variables):
set [iterator v] to [0] //Reset the iterator repeat (length of [all_numbers v]) change [iterator v] by (1) add (item (iterator) of [all_numbers v]) to [selection v] //Copying the numbers over to another list end repeat (length of [selection v]) set [selected v] to (pick random (1) to (length of [selection v])) //Pick a random number add (item (selected) of [selection v]) to [random_order_list v] //Add the corresponding item to the new list delete (selected) of [selection v] endHope this works!
Last edited by mathfreak231 (2013-02-28 16:19:02)
Offline