Ejemplo n.º 1
0
        static int PlayGame()
        {
            Game g = new Game(2);

            // Deal initial cards.
            Console.Out.WriteLine("Drawing initial cards... ");
            for (int i = 0; i < 5; i++)
            {
                foreach (Player p in g.Players)
                {
                    p.AddCard(g.Draw());
                }
            }

            // Let players play.
            int turn = 1;
            int next = 0;
            while (!g.Done())
            {
                Console.Out.Write("Turn {0}: player {1} ", turn++, next + 1);
                Player p = g.Players[next];
                next = (next + 1) % g.Players.Count;

                p.Go();
            }

            int score = g.Deck.Score();
            Console.Out.WriteLine("SCORE: {0}", score);
            Console.Out.WriteLine("");
            return score;
        }