Posts: 270
Threads: 7
Joined: Apr 2015
Код:
for (new i = 1; i < MAX_I_VALUES_HERE; i++)
{
if (!i) continue;
printf('Looping %i', i);
}
Done
Posts: 270
Threads: 7
Joined: Apr 2015
Quote:
Originally Posted by LetsOWN[PL]
Skipping i when it's 0 does not make sense.
What, if i = 10..
|
You mean even that code doesn't work?
Posts: 270
Threads: 7
Joined: Apr 2015
Quote:
Originally Posted by LetsOWN[PL]
I mean your solution does not solve the problem in question.
All your code does is just skip anything in the loop when iterator (i) is equal to 0 (because negation of 0 is 1, so does !i).
The problem is that even for:
for(new i = 5; i < 47; i++)
it will give: 0, 1, 2, 3...
Well, at least that's what this thread is about.
|
Well, my solution gives you what you want.. not counting 0,
if you wanna do "new i = 5" then you must do "if (i < 5) continue;"...
Check your recent changes, maybe something messes this up...
I've never seen such problem tho.
You tried while() ?