For loop doesn't work as expected

Started by
9 comments, last by Jaap85 11 years, 11 months ago
All right, this is the point where i feel relieved but stupid :)

I finally got the code to work and also realised which mistakes i made:

1. When using the "foreach int k in MoveList" statement, i failed to adapt MoveList[k] to k, which makes sure the program goes in an endless loop.

2. I somehow overlooked the fact that the for loop was indeed connecting when debugging, I really don't understand it since i checked it a few dozen times before posting here, but in the end it appeared to work and since i didnt change anything in my code, i really must have overlooked it.

Anyhow, i got the code working and also fixed another mistake which caused the bad results to appear. Thank you very much again for helping me learn!


Now on to the next problem, which should be easier to solve. My girlfriend hates the fact that the stones in my Connect Four game just appear instead of falling down nicely, so i will try to fix that now :)

My personal blog on game development!

Black Wolf Game Development

This topic is closed to new replies.

Advertisement