Random Repetition

For questions about using Classic.

Post » Thu May 24, 2012 5:13 pm

Here: http://www.mediafire.com/file/18ez6q6i60ibwb7/randomunique.cap

EDIT oh, shadowlord beat me to it That brings up the question, why I saw his post not before posting mine tulamide2012-05-24 17:14:57
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu May 24, 2012 8:42 pm

you may trying putting all numers in the array so then apply an loop to radomize the numbers...

capYaottabyte2012-05-24 20:43:09
B
4
S
1
G
1
Posts: 69
Reputation: 863

Post » Fri Nov 01, 2013 12:11 pm

Was trying to solve this same problem as simple as possible and looks like all the .cap files are out of date.

I am trying to create show numbers 1-3 randomly without repeating. Seems pretty simple but I am just getting stuck as my programming skills are not great. Any help is appreciated.

Here is what I have tried.

I have set three global variables.

varX
varY
varZ

On start of layout I am setting each of those...

System > Set varX to floor(random(3)+1)
System > Set varY to floor(random(3)+1)
System > Set varZ to floor(random(3)+1)

I am then setting text boxes on the layout to display each of the variables.

What are my next steps to check that all three numbers are different. 1, 2, 3 should show up in a different order each time.

Any help, explanation, etc. would be greatly appreciated. I am sure there is a much more simple way to approach this. Thanks for the time!
B
8
S
2
G
1
Posts: 18
Reputation: 1,059

Post » Fri Nov 01, 2013 1:15 pm

Took a stab. It seems to be working properly although I am wondering how to optimize make a lot more efficient as I can't imagine this being the most efficient approach. Any suggestions, improvements, etc. are greatly appreciated. Thanks for the time

Here is the link to my .capx file via dropbox:
https://db.tt/AzLg3mehShagenBake2013-11-01 13:17:43
B
8
S
2
G
1
Posts: 18
Reputation: 1,059

Post » Fri Nov 01, 2013 1:17 pm

"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Fri Nov 01, 2013 1:19 pm

Thanks so much for the reply but I am on a newer version of C2 and cannot open to have a look at the example. Appreciate your time uploading Jayjay!
B
8
S
2
G
1
Posts: 18
Reputation: 1,059

Post » Fri Nov 01, 2013 1:20 pm

Just realized this is in the Construct Classic part of the forum and therefore I should move my conversation somewhere else. Should I delete my non relevant post as well? Apologize for not being in the correct place.
B
8
S
2
G
1
Posts: 18
Reputation: 1,059

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests