D
DDanny
Guest
Hello GM community,
I'm currently developing an application for multiple platforms and I came across this issue. After days and days of rigorously looking on Google and the whole Internet I still can't find a sufficient answer so I decided to post a thread here:
All in all, I want to create a random number that is different from others.
When the app first start, it will create 2 different random numbers and draw them to the screen. Since they are the two first it's quite easy to make them different
But there's more. After every 2 seconds I want a new number to be randomly generated, and it should too be different from the rest. Therefore I'm wondering what might be the best way to do this ? I can't just check them one by one because I think that wouldn't be optimized at all (?) I tried using arrays and data lists but I want to know if anyone can think of a better way
Sorry of my lengthy presentation. I'm looking forward to everyone's idea and thank you in advance !
Have a nice day all
I'm currently developing an application for multiple platforms and I came across this issue. After days and days of rigorously looking on Google and the whole Internet I still can't find a sufficient answer so I decided to post a thread here:
All in all, I want to create a random number that is different from others.
When the app first start, it will create 2 different random numbers and draw them to the screen. Since they are the two first it's quite easy to make them different
Code:
number_1 = 1 + irandom(100);
number_2 = 1 + irandom(100);
while (number_2 == number_1)
{
number_2 = 1 + irandom(100);
}
Sorry of my lengthy presentation. I'm looking forward to everyone's idea and thank you in advance !
Have a nice day all