PDA

View Full Version : [Doubt] How to do this.


Tirael
04/07/2017, 05:04 PM
I am trying to make a random number with numbers that I provide but I do not deal with the form.

new Number[MAX_BUSINNES] = 0;
for (new i = 0; i < MAX_BUSINNES; i ++)
{
if (NegociosInfo[i][bizType] == 1)
{
Number[i] = 1;
}
}
// here would go random ...


Sorry for my bad english.
So far everything is correct but the question is, how can I create a randon with the number function in 1?.
+ Rep who help me.

Eoussama
04/07/2017, 05:11 PM
Let me get you straight, you want to generate a random number?

Tirael
04/07/2017, 05:13 PM
A random number with the function Number [i] = 1;

Eoussama
04/07/2017, 05:28 PM
Can you be more explicit?
Do you mean you want to generate random numbers and store them in the Number array? Like

Number[0] = 54515;
Number[1] = 41726;
Number[2] = 57756;
Number[3] = 25254;
//...etc..


like this?

Tirael
04/07/2017, 07:38 PM
My idea is to loop through all Type 1 businesses and store their IDS.
Example:
Business 1, 5, 8, 20.

As I can store those images and then create a loop that does not sea in correlative order if not the 1, 5, 8, 20.

My idea is for the job of truck driver, to look for certain businesses and send it to one obtained at random through the loop.

SpaceX
04/07/2017, 09:05 PM
What is NegociosInfo?

Tirael
05/07/2017, 01:33 AM
Solved.