static void Main(string[] args) { Console.WriteLine("Welcome To TicTacToe"); while (true) { TicTacToe ticTacToe = new TicTacToe(); //To create a board ticTacToe.CreateBoard(); //show the board ticTacToe.ShowBoard(); string firstTurn = ticTacToe.Toss(); // If user doesnt select correct input and want to exit if (!ticTacToe.LetterSelection(firstTurn)) { return; } //If user want to exit in between the game if (!ticTacToe.MakeMove(firstTurn)) { return; } Console.WriteLine("Enter E to exit or any other key to Play Again"); //If user doesnt want to play again if (Console.ReadLine().ToUpper() == "E") { return; } } }
static void Main(string[] args) { //Lay out the player and count variables Console.WriteLine("Welcome to TicTacToe!"); //Print that the game is gonna begin Console.WriteLine("Let's begin"); Console.WriteLine(); //Initializes board with all 0s in the array containing it. TicTacToe.CreateBoard(); //Begin player moves/game... TicTacToe.Player1Move(); TicTacToe.Player2Move(); TicTacToe.Player1Move(); TicTacToe.Player2Move(); TicTacToe.Player1Move(); TicTacToe.Player2Move(); TicTacToe.Player1Move(); TicTacToe.Player2Move(); TicTacToe.Player1Move(); //By this time there should be a winner. If not, the next line executes and the app stops. TicTacToe.GameDraw(); //End game if there is no winner. }