Hi everyone!
I've a big problem with a script who assigns 24 random numbers between 1 and 24 different from each others to black variables or if you don't understand a script who generate 24 random numbers between 1 and 24 including.
I don't found this script anywhere.
Someone can help me?
PS: Sorry for my english but i'm italian
Thanks in advance.
Bye
Offline
Hmm. Not sure what you mean by black variables? Blank variables or what?
---
Assuming that you have the numbers 1-24 and each of them needs to be assigned to a variable.
You could have a list containing the numbers 1 - 24 (filled at the start of the program).
You then set a variable to random number between 1 and 24; the number that is chosen is the item in the list you set to a variable. You also delete that item from the list.
---
Something like this?
Link to Project: Random 24 Numbers
Last edited by BetaSmozzick (2012-12-11 16:51:25)
Offline
Oh sorry I meant to say Blank variables
Offline
Ah, that's fine; I thought that might be the case.
The project I've linked seems like it would do what you need...not sure that 24 separate variables would work so well but if its essential then just after the code in the project set each variable equal to each item in the list.
Offline
Thanks for the answer but i've already tryed this script and it doesn't work! I eliminate the number after they have been assigned to a variable from the list but it happens an error and assigns equal numbers even variables also!
Do you know another methods?Or you have your own project? Maybe I'm wrong a few blocks, but I do not think.
Offline
The project I linked was an example that I created for you and does randomly sort the numbers. I don't quite understand the problems your having with it? Could you try explaining that again?
---
Would you mind uploading your project so that I can try and see what's going wrong?
Last edited by BetaSmozzick (2012-12-11 17:11:03)
Offline
sorry I had not noticed the link, I downloaded it now, I don't understand the "Change to -1" in the second cycle ... my goal would be to bring 24 empty variables to 24 different random numbers, so that the numbers in the list are entered in 24 variables visible on the Stage
Offline
No problem ^^
The change by -1 in the second cycle is because when you delete a number from the list the list becomes 1 item smaller and so any random number longer than the list would result in an error.
---
I thought that it might have to be displayed like that...in which case you would have to individually assign the values to the variables after the second list is filled.
Last edited by BetaSmozzick (2012-12-11 17:16:17)
Offline
Oh perfect. Thank you very much! I solved my problem
Offline
Awesome Glad it worked.
Offline