C++ Tic Tac Toe not changing player?
<p>I've coded this Tic Tac Toe and for Player 1, it works perfectly (hehe). The end game checks all work, so if Xs are entered into spaces 1, 2 and 3 the game ends and asks to repeat etc.</p>

<p>However, the problem I am having is that it never switches to player 2. It will always ask Player 1 to make the next move and therefore will always place Xs. (See screenshot below). The if statement at the very bottom was created to do this and it doesn't appear to be working. I'd appreciate it if someone could tell me what I need to add/change to let it switch players. (I know the code is basic, probably poorly formatted etc, however I started learning C++ a few days ago and this is my first real project). Thanks for the help in advance!</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

// prepare the game
bool GameOver = false;
bool Repeat = false;
bool Winner = false;
int PlayerTurn = 1;
int ChangeNumber;
char Counter = 'Z';
char Board1 = '1';
char Board2 = '2';
char Board3 = '3';
char Board4 = '4';
char Board5 = '5';
char Board6 = '6';
char Board7 = '7';
char Board8 = '8';
char Board9 = '9';

void welcome()
{
    cout &lt;&lt; "Welcome to Tic Tac Toe! This game requires 2 players." &lt;&lt; endl;
    cout &lt;&lt; "Player 1 is represented by X whereas Player 2 is represented by O." &lt;&lt; endl &lt;&lt; endl;
}

int main()
{
    welcome();
    cout &lt;&lt; Board1 &lt;&lt; " - " &lt;&lt; Board2 &lt;&lt; " - " &lt;&lt; Board3 &lt;&lt; endl;
    cout &lt;&lt; Board4 &lt;&lt; " - " &lt;&lt; Board5 &lt;&lt; " - " &lt;&lt; Board6 &lt;&lt; endl;
    cout &lt;&lt; Board7 &lt;&lt; " - " &lt;&lt; Board8 &lt;&lt; " - " &lt;&lt; Board9 &lt;&lt; endl;

    do
    {
        if(PlayerTurn == 1)
        {
            cout &lt;&lt; endl &lt;&lt; "Player 1, it is your turn! Enter the number you wish to change! ";
            Counter = 'X';
        }
        else
        {
            cout &lt;&lt; endl &lt;&lt; "Player 2, it is your turn! Enter the number you wish to change! ";
            Counter = 'O';
        }

        do{
        cin &gt;&gt; ChangeNumber;
        switch(ChangeNumber)
        {
            case 1:
                Board1 = Counter;
                break;
            case 2:
                Board2 = Counter;
                break;
            case 3:
                Board3 = Counter;
                break;
            case 4:
                Board4 = Counter;
                break;
            case 5:
                Board5 = Counter;
                break;
            case 6:
                Board6 = Counter;
                break;
            case 7:
                Board7 = Counter;
                break;
            case 8:
                Board8 = Counter;
                break;
            case 9:
                Board9 = Counter;
                break;
            default:
                cout &lt;&lt; "That is not a valid placement!";
                Repeat = true;
        }
        }while(Repeat == true);

        //check for end of game
        if (Board1 != '1') {
            if (Board2 == Board1 &amp;&amp; Board3 == Board1){
                GameOver = true;
            }
            if (Board4 == Board1 &amp;&amp; Board7 == Board1){
                GameOver = true;
            }
        }
        if (Board5 != '5'){
            if (Board1 == Board5 &amp;&amp; Board9 == Board5){
                GameOver = true;
            }
            if (Board2 == Board5 &amp;&amp; Board8 == Board5){
                GameOver = true;
            }
            if (Board4 == Board5 &amp;&amp; Board6 == Board5){
                GameOver = true;
            }
            if (Board3 == Board5 &amp;&amp; Board7 == Board5){
                GameOver = true;
            }
        }
        if (Board9 != '9') {
            if (Board3 == Board9 &amp;&amp; Board6 == Board9){
                GameOver = true;
            }
            if (Board7 == Board9&amp;&amp; Board8 == Board9){
                GameOver = true;
            }
        }

        //Check not a draw
        if (Board1 != '1' &amp;&amp; Board2 != '2' &amp;&amp; Board1 != '3' &amp;&amp; Board4 != '4' &amp;&amp; Board5 != '5' &amp;&amp; Board6 != '6' &amp;&amp; Board7 != '7' &amp;&amp; Board8 != '8' &amp;&amp; Board9 != '9')
        {
            GameOver = true;
            Winner = false;
        }

        if(GameOver) {
            if(Winner){
                cout &lt;&lt; "Player" &lt;&lt; PlayerTurn &lt;&lt; " wins!" &lt;&lt; endl;
            }

        cout &lt;&lt; Board1 &lt;&lt; " - " &lt;&lt; Board2 &lt;&lt; " - " &lt;&lt; Board3 &lt;&lt; endl;
        cout &lt;&lt; Board4 &lt;&lt; " - " &lt;&lt; Board5 &lt;&lt; " - " &lt;&lt; Board6 &lt;&lt; endl;
        cout &lt;&lt; Board7 &lt;&lt; " - " &lt;&lt; Board8 &lt;&lt; " - " &lt;&lt; Board9 &lt;&lt; endl &lt;&lt; endl;

        cout &lt;&lt; "Game over!" &lt;&lt; endl;
        cout &lt;&lt; "Play again? y/n ";
        char PlayAgain;
        cin &gt;&gt; PlayAgain;

        if (PlayAgain == 'y'){
            GameOver = false;

            Board1 = '1';
            Board2 = '2';
            Board3 = '3';
            Board4 = '4';
            Board5 = '5';
            Board6 = '6';
            Board7 = '7';
            Board8 = '8';
            Board9 = '9';
        }
        PlayerTurn = 1;

        }
        else {
            if (PlayerTurn == 1){
                PlayerTurn == 2;
            } else {
                PlayerTurn == 1;
            }
        }
    }while(GameOver == false);
}
</code></pre>

<p><img src="http://i.stack.imgur.com/cMJ4q.png" alt="enter image description here"></p>
