#include #include "TicTac.h" main() { cout << "Game of Tic Tac Toe against the Computer... \n"; TicTacToe board; int R, C; // row and column for a move int Value; // value of a move: 0, 1, 2, or 3 Side who = Computer; // human moves first while (!board.IsAWin(who) && !board.BoardIsFull()) { who = (Side)((who + 1) % 2); // alternate turns if (who==Computer) { Value = board.ChooseMove(who, R, C); // computer's move cout << "Computer's move (value = " << Value << "):\n\n"; } else board.GetMove(R, C); // human's move board.PlayMove(who, R, C); // play the move board.Display(); // and show the board } if (board.IsAWin(who)) if (who==Human) cout << "Wow, you win!"; else cout << "Computer wins!"; else cout << "Tie game."; }