Pages: 1
Hello beautiful people,
i wanted to ask a question as i seem to be in a runt with it. I want to record the random generated values, i imagine it should have something to do with broadcast, but i run into a problem that the second random variable is generated, the first one gets rewritten, and i want to record them all, so later i could differentiate the order they were generated, from first to last.
Any help?
Thanks
Offline
This sounds like a great list-study project.
You do not need to broadcast anything.
I'll try to scratchblocks the algorithm for you:
list name: random_numbers
when gf clicked delete [all v] of [random_numbers v] repeat [10] add <pick random [1] to [10]> to [random_numbers v] endThen to recall one of those numbers you can do the following
set [foo v] to (item <pick random [1] to (length of [random_numbers v])> of [random_numbers v])Ugh! Scratchblocks can be painful to get right.
Last edited by dechan (2013-02-06 22:27:03)
Offline
I think he means sorting a list of random numbers.
I would probably do a merge sort, but those would be hard.
A simple bubble sort would first
-add all random numbers to list
-do a repeat loop for the length of the list
will think of more later
Offline
Pages: 1