Page 1 of 11
Forum moderator: bigblog 
uCoz Community » Communication » uCoz Discussions » <?rnd(N)?> (rnd in if)
<?rnd(N)?>
HendrixCowl
Posts: 2
Reputation: 0

Message # 1 | 8:49 AM
Hi. Could anyone help me?

<?rnd(1)?> works - random number 0 to 1

But how do it do this?:
<?if (<?rnd(1)?> = 0)?>do this<?else?>do this<?endif?>

cause it doesnt work.

Thanks a lot.
Eriko
Pokémon Master
Posts: 958
Reputation: 33

Message # 2 | 10:24 AM
Code
<?if(rnd(1) = 0)?>do this<?else?>do this<?endif?>


try that one.
Post edited by Eriko - Tuesday, 2015-05-05, 10:24 AM
HendrixCowl
Posts: 2
Reputation: 0

Message # 3 | 12:40 PM
Okey. Thanks.

<?if(rnd 1 = 0)?> do this 0<?else?>do this 1<?endif?>

works!

But

how can i put exact text in exact random number, for example:
<?if(rnd 3 = 0)?> do this 0 <?else... for 1 else for 2 else for 3??

Thanks!!
uCoz Community » Communication » uCoz Discussions » <?rnd(N)?> (rnd in if)
Page 1 of 11
Search: