25.02.2014, 15:54
for(new i = 19; i == 0; i --)
what you're doing is:
for( new i = 19; //the variable i has now an integer value of 19;
i == 0; // checking if i is equal to 0, which it isn't because it's 19.
i-- // if i is equal to 0, lower the value with 1.
this will never work, as the variable i, is 19, and it ain't 0, so this will create a never ending loop, because i is always 19, and will never decrease as it only decreases when it's 0.
try this instead:
for( new i = 19; i > 0; i-- )
that checks if i is still above 0, if it is, it'll continue, else it'll stop.
what you're doing is:
for( new i = 19; //the variable i has now an integer value of 19;
i == 0; // checking if i is equal to 0, which it isn't because it's 19.
i-- // if i is equal to 0, lower the value with 1.
this will never work, as the variable i, is 19, and it ain't 0, so this will create a never ending loop, because i is always 19, and will never decrease as it only decreases when it's 0.
try this instead:
for( new i = 19; i > 0; i-- )
that checks if i is still above 0, if it is, it'll continue, else it'll stop.