We are about to switch to a new forum software. Until then we have removed the registration on this forum.
For a snake game, I have the food teleport to a random spot on the screen when you eat it, but it's possible for the food to end up on your tail, and not on an empty space. Basically, I sort of need some way to check if the food's x is in the arrayList for the snake's x, and the smae with y, and if so, to execute an action until that is not true.
Answers
like this....?
Yes, thank you. I completely forgot about the possibility of using return true / false.
A do... while loop is better if you know that the loop is going to be done at least once, less repetition (your lines 13, 14 are identical to lines 18, 19)
(Untested)
thanks!