Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange loops?

 
Gintaras Bubelevicius
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, this is strange, using LibGDX for Android, but this seems to be irrelevant. Anyway, there's few loops that I should go through, but when I run/debug the application it just seems to skip over the loops and doesn't even bother to evaluate. I did try to change my for loop into a while loop, but there seems to be no difference. Parts of my code with loops:
blockNumber equals 14 in the debuger.


even a simple loop as: for (i=1; i >= 14; i++) { //whatever } just steps into it and next step jumps over after the loop...
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to say what's happening since we're only seeing partial code. For example, I'm not sure what the second code block is for - it doesn't seem to go with the first code block, or with your last loop example.

If blockNumber = 14, then obviously it would not enter the loop in the first example.

Just as obviously, a loop start starts at i=1, and has a condition of "i>=14", will never be executed.
 
Gintaras Bubelevicius
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, was working late till 5am so probably that got me seems it was just the more/less signs... was so sure it should work
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic