Beispiel #1
0
        public static string GetPlayerInput(string prompt)

        {
            Console.WriteLine(prompt);
            string input = "";

            do

            {
                input = Console.ReadLine();

                if (input == "/help")

                {
                    Gameboard.PrintHelpKey();
                    Thread.Sleep(500);
                    Console.WriteLine("\nNow, " + prompt);
                }

                else

                {
                    return(input);
                }
            } while (input == "" || input == "/help");

            ThrowError(3, "Escaped GetPlayerInput Method Loop");
            return(input);
        }
Beispiel #2
0
        static Gameboard Setup(ref Gameboard board, ref Player player1, ref Player player2)
        {
            Console.WriteLine("Welcome to Tic Tac Toe!" + "\n");

            if (player1.score == 0 && player2.score == 0)
            {
                Thread.Sleep(1000);
                Gameboard.PrintHelpKey();
            }

            else
            {
                PrintScoreboard(player1, player2);
                board.WipeBoard();
            }

            player1.UpdatePlayerVictoryStatus(false);
            player2.UpdatePlayerVictoryStatus(false);

            AssignPlayerTypes(ref player1, ref player2);
            AssignPlayerSymbolsAndTurn(ref player1, ref player2);

            return(board);
        }