Random Multiple choice with exclusions

Get help using Construct 2

Post » Thu Nov 08, 2012 4:21 pm

Hello everybody. I've been looking around but my question right now is a bit precise so I didn't find anything. Here is my problem:

I want to be able to random choose among some items (each with a number, for example), so the next time I have to choose, the ones chosen before won't be available, like this:

I have items 1 to 5. Random gets number 2.
Next cycle, I have items 1, 3, 4 and 5. Random gets 5.
Next cycle, I have items 1, 3 and 4. And so on.

The way to treat the items is not really important, I don't mind using objects, variables or whatever, it's just that without programming, I don't know how to approach this problem.
B
9
S
1
Posts: 5
Reputation: 741

Post » Thu Nov 08, 2012 5:30 pm

This works.
Set Text to tokenat(replace("1,2,3,4,5,", Text.Text & ",", ""),int(random(4)), ",")
B
79
S
24
G
54
Posts: 4,740
Reputation: 40,743

Post » Mon Nov 12, 2012 8:47 am

Thanks for the answer, though it's quite the complicated sentence there. I had to break it down to try to understand what was going on there.
B
9
S
1
Posts: 5
Reputation: 741


Return to How do I....?

Who is online

Users browsing this forum: jul, nimos100 and 17 guests