Is the first time that im using for-each loop so i dont know what im doing wrong. I have a 2-D array that i want to scan to find some elements. So i create a class Coordinate() that takes two integers (row, column) and addCoordinate() method where each variable added to itself.
Pawn starting always at the bottom of theArray (the last row of the array) For example if is starting on theArray (Stone) and at theArray there is another Stone and between them there ara Bridge elements then sets
but if standing on theArray then
So starting and ending points are the same object. I cant understand why?
I'm not sure I understand your question that clearly, is there anyway you could post an example of your problem that compiles so we can test it. Also you are not using a 2d array, you are using a 1d array that has objects inside it.
"If the facts don't fit the theory, get new facts" --Albert Einstein