How do I Assign A Number Randomly Without Repeating Numbers?

Get help using Construct 2

Post » Sat Feb 13, 2016 8:52 am

Hello and thanks for looking.

How would I go about assigning a random number to several items without repeating a number?

Thanks for your time.
B
25
S
7
Posts: 79
Reputation: 2,267

Post » Sat Feb 13, 2016 9:35 am

You need to use an array for this. Do you know how to use it?

If not, take look at https://www.scirra.com/tutorials/307/ar ... ers/page-4

Here an example of how you can do to use an array to assign numbers without repetition:

https://www.dropbox.com/s/4xkt8i582ds8f ... .capx?dl=0

Good luck
B
72
S
13
G
2
Posts: 989
Reputation: 6,969

Post » Sat Feb 13, 2016 4:55 pm

ImageImageImage
B
71
S
20
G
191
Posts: 3,535
Reputation: 108,844

Post » Mon Feb 15, 2016 12:51 am

Thank you RBuster and blackhornet for the replies.

RBuster, I wanted to specifically thank you for not only leading me to an answer but by going above and beyond and creating a capx that was both simple and elegant. Being able to see what was going on helped immensely and I was able to apply it to my code with little trouble.
Thanks so much. :)
B
25
S
7
Posts: 79
Reputation: 2,267


Return to How do I....?

Who is online

Users browsing this forum: Benjo11, Fasold and 1 guest