Random checkpoint except last one
#4

Never use goto. If anything use do-while.

PHP код:
do 
{
    
newthing random(/* ... */);
}
while(
newthing == oldthing); 
This has the possibility of an infinite loop so create some kind of guard (maximum 50 iterations or so) so it doesn't go on forever.
Reply


Messages In This Thread
Random checkpoint except last one - by TheWay - 02.08.2015, 08:57
Re: Random checkpoint except last one - by Mariciuc223 - 02.08.2015, 09:02
Re: Random checkpoint except last one - by Mencent - 02.08.2015, 09:12
Re: Random checkpoint except last one - by Vince - 02.08.2015, 10:24

Forum Jump:


Users browsing this thread: 2 Guest(s)