I’ve made my program so that it prints out the element in a 2D array that is directly to it’s right at the begining of a loop (the one with the <3 at the begining), and prints out itself at the end of the loop. However, the print message with the <3 is also displayed at the end of the loop, with the values of the element that is directly to its right at this point.
I’ve removed a large ammount of my code, as I feel as though it is not relevant to this issue. Let me know if I’ve left out something that may be important. (The print <3 does not exist anywhere else in my code; only the one time in the condensed version bellow).
public class C_Generate_Level : MonoBehaviour {
void Start ()
{
const int ONE = 1;
const int GRID_HEIGHT = 1;
const int GRID_WIDTH = 5;
const int REPEAT_LIMIT = 10;
int heightCounter;
int widthCounter;
int tileRedoCounter;
bool bStop;
for (heightCounter = ONE; heightCounter < (GRID_HEIGHT - ONE); heightCounter++)
{
for (widthCounter = ONE; widthCounter < (GRID_WIDTH - ONE); widthCounter++)
{
bStop = false;
for (tileRedoCounter = 0; tileRedoCounter <= REPEAT_LIMIT; tileRedoCounter++)
{
print ("<3 Previous tile was: "); //This prints twice each time, but it shouldn't
do_while_counter = 0;
do
{
bStop = true;
print ("The current tile is: "); //This prints once each time, as it should
break;
}
else
{
tilesAry[heightCounter, widthCounter].rotate(holdRotate);
}
} while (0 != tilesAry[heightCounter, widthCounter].get_rotation());
}
}
}
}
}