How do I use random expression without fractional part?

Get help using Construct 2

Post » Sat Aug 13, 2016 8:40 pm

Hi everyone how do i use "random" expression without fractional part?

When i use random expression,it chooses values with fractional part like (73.23321 , 19.49994 , 29.322211)

I want to use without fractional part like (12 , 42 , 94 , 13)

Sorry for bad english.

Thanks.

Example Capx : https://drive.google.com/open?id=0B9xK1 ... Hl6VzYyYjA
B
23
S
11
G
1
Posts: 127
Reputation: 2,737

Post » Sat Aug 13, 2016 8:48 pm

int(random(100))
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Sat Aug 13, 2016 10:56 pm

blackhornet wrote:int(random(100))


thanks
B
23
S
11
G
1
Posts: 127
Reputation: 2,737

Post » Sun Aug 14, 2016 12:44 pm

You can also use round(x), ceil(x), floor(x) - depending what you want to do.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393


Return to How do I....?

Who is online

Users browsing this forum: DjowG and 9 guests