Slurpee Posted May 10, 2003 Posted May 10, 2003 ok a quick question. I hava a nested for loop like say for x=0 to 10 for y =0 to 10 if some condition is true array (x+1, y-1)=T AND array (x=2, y-2)=T next y,x is there a way to increment to counters concurently so that i can get rid of the inner conditiuon (which happens to be a lot more complex) I know you can do this in java and C but in VB i'm not sure. Anyone???? Quote
Leaders Squirm Posted May 10, 2003 Leaders Posted May 10, 2003 Show what you would do in C or Java because I really don't understand. You can add to loop counters - they are still regular variables. Quote Search the forums | Still IRCing | Be nice
bzbiz Posted May 12, 2003 Posted May 12, 2003 hi for x=0 to 10 for y =0 to 10 if condition = true then array (x+1, y-1)=T AND array (x=2, y- 2) =T end if next y next x Like this? Your question is not so clear, i think. ByeZ By BiZ Quote Join The Brotherhood Of NOD
*Experts* Nerseus Posted May 12, 2003 *Experts* Posted May 12, 2003 Squirm was saying that you can change the values of your x and y loop variables inside the loop, to fit your needs, if you really need to change the values (it's generally not a good idea). If we knew *exactly* what you wanted (change the value of x or y OR change your "if condition = true" logic), we could offer more concrete help. If you really mean to assign x the value of 2 in the loop, you could write: for x=0 to 10 for y =0 to 10 if condition = true then array (x+1, y-1)=T array (x, y- 2) =T x = 2 end if next y next x or maybe you want: for x=0 to 10 for y =0 to 10 if condition = true then array (x+1, y-1)=T x = 2 array (x, y- 2) =T end if next y next x -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.