%   TTTClickSquarePBCB.m
%   Description:
%   Inputs:
%   Outputs:
%   Team DATT "All DATT and dim sum."

if GameOver == false
    StartNewGame = true; %Confirmation for TTTNewGamePBCB that a new game must start because this one is in progress
    
    if CurrentPlayer == 'Human'
        if get(gcbo,'string') == ' '
            SquarePosition = get(gcbo,'tag');
            SquarePosition = str2num(SquarePosition(4)); %Assigns Square # (4th char in tag)

            if CurrentTurn == 'X'
                set(gcbo,'string','X')
                MainGame(SquarePosition) = -1; %-1 represents X's
                CurrentTurn = 'O';
            else
                set(gcbo,'string','O')
                MainGame(SquarePosition) = 1; %-1 represents O's
                CurrentTurn = 'X';
            end
            CurrentPlayer = 'Compu';
        else
            break %Space is taken, not a valid move.
        end
        TTTWhoWon
        if GameOver == false
            TTTCompMove
        end
    else
        TTTCompMove
    end
end