Exemple #1
0
 public void playgame()
 {
     Game.printGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "a turn ");
         P1.PickBall(Game);
         Game.printGame();
         if (Game.isgameover())
         {
             Console.WriteLine(P1.GetName() + "loses ");
             Console.WriteLine(P2.GetName() + " wins ");
             break;
         }
         Console.WriteLine(P2.GetName() + "a turn");
         P2.PickBall(Game);
         Game.printGame();
         if (Game.isgameover())
         {
             Console.WriteLine(P2.GetName() + "loses ");
             Console.WriteLine(P1.GetName() + " wins ");
             break;
         }
     }
 }
Exemple #2
0
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "a turn");
         P1.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " Hung da thua");
             Console.WriteLine(P2.GetName() + " Nhan da thang");
             break;
         }
         Console.WriteLine(P2.GetName() + " a turn");
         P2.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " Nhan da thua ");
             Console.WriteLine(P1.GetName() + "Hung da thang ");
             break;
         }
     }
 }
Exemple #3
0
 public void Playgame()
 {
     Game.Printgame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + " a turn");
         P1.PickBall(Game);
         Game.Printgame();
         if (Game.Isgameover())
         {
             Console.WriteLine(P1.GetName() + "Loses");
             Console.WriteLine(P2.GetName() + "Win");
             break;
         }
         Console.WriteLine(P2.GetName() + " a turn");
         P2.PickBall(Game);
         Game.Printgame();
         if (Game.Isgameover())
         {
             Console.WriteLine(P1.GetName() + "Win");
             Console.WriteLine(P2.GetName() + "Lose");
             break;
         }
     }
 }
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "'a turn");
         P1.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + "loses");
             Console.WriteLine(P1.GetName() + "wins");
             break;
         }
         Console.WriteLine(P2.GetName() + "' a turn");
         P2.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " loses");
             Console.WriteLine(P1.GetName() + "wins");
             break;
         }
     }
 }
Exemple #5
0
        public void PlayGame()
        {
            Game.PrintGame();
            while (true)
            {
                Console.WriteLine();
                Console.WriteLine(P1.GetName() + " Play...");
                P1.PickBall(Game);
                Game.PrintGame();
                if (Game.IsGameOver())
                {
                    Console.WriteLine();
                    Console.WriteLine("Player 1 : U LOSE =)) ");
                    break;
                }
                Console.WriteLine();
                Console.WriteLine(P2.GetName() + " Play...");
                P2.PickBall(Game);
                Game.PrintGame();
                if (Game.IsGameOver())
                {
                    Console.WriteLine();
                    Console.WriteLine("Player 2 : U LOSE =)) ");

                    break;
                }
            }
        }
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         P1.PickBall(Game);
         Console.WriteLine(P1.GetName() + "plays...");
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("P1 Game Over");
             break;
         }
         P2.PickBall(Game);
         Console.WriteLine(P2.GetName() + "plays...");
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("P2 Game Over ");
             break;
         }
     }
 }