I am having some problems with solving this game. any ideas
#include <iostream>
int main()
{
char a = ' ', b = ' ', c = ' ',
d = ' ', e= ' ' , f = ' ',
g = ' ', h = ' ', i = ' ';
std::cout << " Tic - Tac - Toe " << std::endl;
std::cout << a << "|" << b << "|" << c << std::endl
<< "-+-+-" << std::endl
<< d << "|" << e << "|" << f << std::endl
<< "-+-+-" << std::endl
<< g << "|" << h << "|" << i << std::endl;
{
bool xWinRow0 = ('X' == a && a == b && b == c);
bool xWinRow1 = ('X' == d && d == e && e == f);
bool xWinRow2 = ('X' == g && g == h && h == i);
bool xWinCol0 = ('X' == a && a == d && d == g);
bool xWinCol1 = ('X' == b && b == e && e == h);
bool xWinCol2 = ('X' == a && a == d && d == g);
bool xWinDia0 = ('X' == a && a == e && e == i);
bool xWinDia1 = ('X' == c && c == e && e == g);
bool xWin = (xWinRow0 || xWinRow1 || xWinRow2
|| xWinCol0 || xWinCol1 || xWinCol2
|| xWinDia0 || xWinDia1);
std::cout << " X Wins!. Thanks for playing. " << std::endl;
}
{
bool oWinRow0 = ('O' == a && a == b && b == c);
bool oWinRow1 = ('O' == d && d == e && e == f);
bool oWinRow2 = ('O' == g && g == h && h == i);
bool oWinCol0 = ('O' == a && a == d && d == g);
bool oWinCol1 = ('O' == b && b == e && e == h);
bool oWinCol2 = ('O' == a && a == d && d == g);
bool oWinDia0 = ('O' == a && a == e && e == i);
bool oWinDia1 = ('O' == c && c == e && e == g);
bool oWin = (oWinRow0 || oWinRow1 || oWinRow2
|| oWinCol0 || oWinCol1 || oWinCol2
|| oWinDia0 || oWinDia1);
std::cout << "O wins. Thanks for playing." << std::endl;
}
{
bool allTaken = ( a != ' ' && b != ' ' && c != ' '
&& d != ' ' && e != ' ' && f != ' '
&& g != ' ' && h != ' ' && i != ' ');
std::cout << "We have a tie" << std::endl;
}
// prompt player for location
char turn = ' ';
char location = ' ';
std::cout << "player " << turn
<< ": Please enter location (a, b, c, d, e, f, g, h, i): ";
std::cin >> location;
std::cout << "turn : " << turn << std::endl;
return 0;
}