The Dink Network

Reply to Re: Random function: Helpo-pleaso

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 15th 2008, 05:00 PM
dinkdead.gif
In slayer's die procedure:
int &rand = random(15, 1);
if (&rand == 1)
//^doesn't have to be 1, anything up to 15.
{
//make potion
}

Following attached to screen (or a sprite):
void main (void)
{
int &rand = random(22, 1);
if (&rand <= 3)
{
&rand = random(3, 1);
if (&rand >= 2)
{
if (&rand == 3)
{
//create 1 bonca here
}
//create 1 bonca here
}
//create 1 bonca here
}
kill_this_task();
}

I think this is what you meant? So there is a 19 in 22 chance of there being no boncas.

Edit: The line &rand = random(3, 1); is unecessary, take it out if you like.