Generate number range.

New releases and general discussions.

Post » Thu Jun 10, 2010 12:17 am

Instead of just generating from 0 to a number can it be number to number? like 10 to 20 and it will make numbers like 12 17 20 11 10. Because I don't see that feature in there. :P
B
4
S
1
G
2
Posts: 18
Reputation: 886

Post » Thu Jun 10, 2010 12:31 am

for 10 through 20 you would do
random(10)+10

also, under math in the 's' plugin there is a ranged random
that lets you do that s.random(10,20)

it also has the benefit of being a seeded random, so you can generate the same random sequence again later if needed
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Jun 10, 2010 2:54 am

[quote="lucid":3i6fpt93]for 10 through 20 you would do
random(10)+10

also, under math in the 's' plugin there is a ranged random
that lets you do that s.random(10,20)

it also has the benefit of being a seeded random, so you can generate the same random sequence again later if needed[/quote:3i6fpt93]
lol, I never really thought of doing that. Thanks.
B
4
S
1
G
2
Posts: 18
Reputation: 886

Post » Sat Jun 19, 2010 8:50 pm

A warning, 10+random(10) will only go to 19, so you should actually write 10+random(11). It's just how Random works.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest