Hi. I am currently writing a block of code to loop through a vector and generate all possible moves on a game. For my first for loop, this block of code never increments x.
I even stuck an x = x+1 at the end of the block and it just resets x to zero. Any ideas as to why this is happening?
// Testing singlular crossouts
int x;
for(x = 0; x < boardsize; x++)
{
cout << "Board Size: " << boardsize << endl;
cout << "reached here" << endl;
if(x = i)
{
tempBoard.push_back(0);
cout << "ZERO" << endl;
}
else if(x != i)
{
cout << "X IS NOT I" << endl;
cout << board.at(x) << endl;
tempBoard.push_back(board.at(x));
}
cout << "i: " << i << endl;
cout << "x: " << x << endl;
x = (x + 1);
cout << "changed x: " << x << endl;
}