Exemplo n.º 1
0
        void PlayTheGame(WarCardGame war)
        {
            war.StartNewGame();

            while (!war.EndOfGame())
            {
                war.NextCard();
            }

            if (war.p1.cards.Count == 0)// COME BACK HERE WHEN YOU RE DONE
            {
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine("{0} HAS WON  {1}", war.p2.name, war.p2.cards.Count);
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("{0} HAS LOST {1}", war.p1.name, war.p1.cards.Count);
                Console.ResetColor();
            }
            else if (war.p2.cards.Count == 0)
            {
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine("{0} HAS WON {1}", war.p1.name, war.p1.cards.Count);
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("{0} HAS LOST {1}", war.p2.name, war.p2.cards.Count);
                Console.ResetColor();
            }
        }
Exemplo n.º 2
0
        void PlayTheGame(WarCardGame war)
        {
            war.StartNewGame();

            while (!war.EndOfGame())
            {
                war.NextCard();

                //adds delay between each loop
                //System.Threading.Thread.Sleep(400);
            }
        }