for(initialization;loopstart/conditional;loopend)
{
code;
}
initialization;
while(loopstart/conditional)
{
code;
loopend;
}
The only difference between these two1 is that for the while loop, using "continue;" would make the loopend part not run.
for(%i=0;%i<10;%i++) //Echoes 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9
{
echo(%i);
continue;
}
%i = 0;
while(%i < 10) //Echoes 0 in an infinite loop. Freezes your game2.
{
echo(%i);
continue;
%i++;
}
1As far as I know/remember at this time.
2That code simplifies to while(true) { echo(%i); } due to the continue;.