Choosing random variable
#1

Код:
new a[5];

a[0]=1;
a[1]=4;
a[2]=0;
a[3]=7;
a[4]=0;
I need to find which of these variables aren't equal zero and then randomly choose on of them (of those that aren't equal 0).

I guess start should look something like this...
Код:
for(new i; i<5; i++)
{
 if(a[i]!=0)
  {
  // dont know what to do
  }
}
Reply


Messages In This Thread
Choosing random variable - by Aa12 - 24.03.2016, 20:47
Re: Choosing random variable - by SickAttack - 24.03.2016, 21:05
Re: Choosing random variable - by Aa12 - 24.03.2016, 21:27
Re: Choosing random variable - by SickAttack - 24.03.2016, 21:31
Re: Choosing random variable - by Aa12 - 24.03.2016, 22:07

Forum Jump:


Users browsing this thread: 1 Guest(s)