02.08.2015, 10:24
Never use goto. If anything use do-while.
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.
PHP код:
do
{
newthing = random(/* ... */);
}
while(newthing == oldthing);