Пример #1
0
        static void Main(string[] args)
        {
            // create player 1 using default constructor
            Player p1 = new Player();
            // create player 2 passing the name
            Player p2 = new Player("Chungo");

            //object initializer

            GameWorkflow game = new GameWorkflow()
            {
                Player1 = p1,
                Player2 = p2
            };

            game.PlayGame();
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Player p1 = new Player("Player 1");
            Player p2 = new Player();
            string keepPlaying = "n";

            while (keepPlaying == "n")
            {
                GameWorkflow game = new GameWorkflow();

                game.player1 = p1;
                game.player2 = p2;

                game.PlayGame();

                Console.WriteLine("\nEnter n to start a new game, enter q to quit:");
                keepPlaying = Console.ReadLine();
            }

            Console.WriteLine("\n\nDone playing! Press a key to close the board.");
            Console.ReadLine();
        }