public static void DisplayErrorMessage(int Player) { Console.Clear(); GameBoard.Render(BoardArray); Console.WriteLine("Try again, Player {0}! That space has already been taken!" + "\nPress any key to continue.", Player); Console.ReadKey(); }
static void Main(string[] args) { //introduction menu Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(@" _______ _ _______ _______ _ "); Console.WriteLine(@" |__ __(_) |__ __| |__ __| | |"); Console.WriteLine(@" | | _ ___ | | __ _ ___ | | ___ ___| |"); Console.WriteLine(@" | | | |/ __| | |/ _` |/ __| | |/ _ \ / _ \ |"); Console.WriteLine(@" | | | | (__ | | (_| | (__ | | (_) | __/_|"); Console.WriteLine(@" |_| |_|\___| |_|\__,_|\___| |_|\___/ \___(_)"); Console.ResetColor(); Console.WriteLine("Welcome to Tic Tac Toe, press any key to begin"); Console.ReadKey(); Console.Clear(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("RULES"); Console.ResetColor(); Console.WriteLine("Tic Tac Toe is a two player turn based game." + "\nIt's you vs your opponent..." + "\nPress any key to continue"); Console.ReadKey(); Console.Clear(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("RULES"); Console.ResetColor(); Console.WriteLine("Players are represented with a unique signature." + "\nPlayer 1 = O. Player 2 = X" + "\n\nThe first player to score three signatures in a row is the winner" + "\nGood luck players!" + "\nNow press any key to begin..."); Console.ReadKey(); Console.Clear(); //main game loop while (Running) { GameBoard.Render(BoardArray); TakeATurn(); CheckForWin(); } Environment.Exit(0); }