示例#1
0
 public void PlayGame()
 {
     game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + " turn");
         P1.PickBall(game);
         if (game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " loses ");
             Console.WriteLine(P2.GetName() + " wins ");
             break;
         }
         game.PrintGame();
         Console.WriteLine(P2.GetName() + "turn");
         P2.PickBall(game);
         if (game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " wins ");
             Console.WriteLine(P2.GetName() + " loses ");
             break;
         }
         game.PrintGame();
     }
 }
示例#2
0
文件: Controller.cs 项目: HuyenNgu/pb
 //play
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.Write(P1.GetName() + "turn ");
         P1.PickBalls(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + "loses");
             Console.WriteLine(P2.GetName() + "Wins");
             break;
         }
         Console.Write(P1.GetName() + "turn ");
         P2.PickBalls(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " Loses");
             Console.WriteLine(P1.GetName() + " Wins");
             break;
         }
     }
 }
示例#3
0
 public void PlayGame()
 {
     Game.Printgame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "'s turn");
         P1.Pickball(Game);
         Game.Printgame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + "\t" + "LOSES!");
             Console.WriteLine(P2.GetName() + "\t" + "WINS!");
             break;
         }
         Console.WriteLine(P2.GetName() + "'s turn");
         P2.Pickball(Game);
         Game.Printgame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + "LOSES!");
             Console.WriteLine(P1.GetName() + "WINS!");
             break;
         }
     }
 }
示例#4
0
        public void PlayGame()
        {
            Game.Printgame();
            while (true)
            {
                Console.WriteLine(P1.GetName() + " play: ");
                P1.PickBalls(Game);
                Game.Printgame();
                if (Game.IsgameOver())
                {
                    Console.WriteLine(P2.GetName() + " play: ");
                    break;
                }


                Console.WriteLine("Player2 pickBall: ");
                P2.PickBalls(Game);
                Game.Printgame();
                if (Game.IsgameOver())
                {
                    Console.WriteLine("Player2 lose!");
                    break;
                }
            }
        }
示例#5
0
 public void playGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "Play");
         P1.PickBall(Game);
         if (Game.IsGameOVer())
         {
             Console.WriteLine(P1.GetName() + "lose");
             Console.WriteLine(P2.GetName() + " win");
             break;
         }
         Game.PrintGame();
         Console.WriteLine(P2.GetName() + " play");
         P2.PickBall(Game);
         if (Game.IsGameOVer())
         {
             Console.WriteLine(P2.GetName() + "lose");
             Console.WriteLine(P1.GetName() + " win");
             break;
         }
         Game.PrintGame();
     }
 }
示例#6
0
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + "'s turn");
         P1.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " is lost !");
             Console.WriteLine(P2.GetName() + " is a champion !");
             break;
         }
         Console.WriteLine(P2.GetName() + "'s turn");
         P2.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " is lost !");
             Console.WriteLine(P1.GetName() + " is a champion !");
             break;
         }
     }
 }
示例#7
0
 public void PlayGames()
 {
     while (game.isGameOver() != true)
     {
         game.PrintGame();
         P1.pickball(game);
         if (game.isGameOver())
         {
             Console.WriteLine(P1.GetName() + "Loses");
             Console.WriteLine(P2.GetName() + "Wins");
             break;
         }
         Console.WriteLine(P2.GetName() + "a turn");
         game.PrintGame();
         P2.pickball(game);
     }
 }
示例#8
0
 public void PlayGame()
 {
     while (true)
     {
         Game.PrintGame();
         P1.PickBall(Game);
         if (Game.IsGameOver())
         {
             Console.WriteLine("{0} loses AND {1} wins", P1.GetName(), P2.GetName());
             break;
         }
         Game.PrintGame();
         P2.PickBall(Game);
         if (Game.IsGameOver())
         {
             Console.WriteLine("{0} loses AND {1} wins", P2.GetName(), P1.GetName());
             break;
         }
     }
 }
示例#9
0
 public void PlayGame()
 {
     game.PrintGame();
     while (true)
     {
         Console.WriteLine("{0} plays...", P1.GetName());
         P1.PlayGame(game);
         game.PrintGame();
         if (game.isGameOver())
         {
             Console.WriteLine(P1.GetName() + " win");
             break;
         }
         Console.WriteLine("{0} plays...", P2.GetName());
         P2.PlayGame(game);
         game.PrintGame();
         if (game.isGameOver())
         {
             Console.WriteLine(P2.GetName() + " win");
             break;
         }
     }
 }
示例#10
0
 public void Playgame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine("{0} plays...", P1.GetName());
         P1.PickBalls(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " win");
             break;
         }
         Console.WriteLine("{0} plays...", P2.GetName());
         P2.PickBalls(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " win");
             break;
         }
     }
 }
示例#11
0
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + " play");
         P1.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("P1 game over");
             break;
         }
         Console.WriteLine(P2.GetName() + " play");
         P2.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("P2 game over");
             break;
         }
     }
 }
示例#12
0
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + " Player 1 : ");
         P1.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("Player 1 : You Lose");
             break;
         }
         Console.WriteLine(P2.GetName() + " Player 2 : ");
         P2.PickBall(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine("Player 2 : You Lose");
             break;
         }
     }
 }