예제 #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;
         }
     }
 }
예제 #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() + "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;
         }
     }
 }
예제 #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() + " 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;
         }
     }
 }
예제 #4
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(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;
         }
     }
 }
예제 #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;
                }
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            P1 p1 = new P1();
            P2 p2 = new P2(p1.u);

            double[,] m1 = { { 1, 4, 2, 3 }, { 2, 4, 0, 1 }, { 2, 5, 8, 2 }, { 2, 1, 1, 11 } };
            double[,] m2 = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
            matp M1 = new matp(m1);
            M1.afis();
            matp M2 = new matp(m2);
            M2.afis();


            opr.mul(M1, M2).afis();
            P3.mulStrass(M1, M2, 2).afis();



            Console.WriteLine("\n\nDONE !");
            Console.Read();
        }
예제 #7
0
 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;
         }
     }
 }
예제 #8
0
        static void Main(string[] args)
        {
            P1 p1 = new P1();
            P2 p2 = new P2(p1.u);

            double[,] m1 = { { 1, 4, 2, 3 }, { 2, 4, 0, 1 }, { 2, 5, 8, 2 }, { 2, 1, 1, 11 } };
            double[,] m2 = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
            matp M1 = new matp(m1);

            M1.afis();
            matp M2 = new matp(m2);

            M2.afis();


            opr.mul(M1, M2).afis();
            P3.mulStrass(M1, M2, 2).afis();



            Console.WriteLine("\n\nDONE !");
            Console.Read();
        }
예제 #9
0
 public void PlayGame()
 {
     Game.PrintGame();
     while (true)
     {
         Console.WriteLine(P1.GetName() + " Plays ....");
         P1.Pickball(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P1.GetName() + " You Lose");
             break;
         }
         Console.WriteLine(P2.GetName() + " Plays ....");
         P2.Pickball(Game);
         Game.PrintGame();
         if (Game.IsGameOver())
         {
             Console.WriteLine(P2.GetName() + " You Lose");
             break;
         }
     }
 }
예제 #10
0
        public void Playgame()
        {
            Game.PrintGame();
            while (true)
            {
                Console.WriteLine(P1.Getname() + " luot 1 ");
                P1.PickBall(Game);
                if (Game.Gameover())
                {
                    Console.WriteLine(P1.Getname() + "WIN");
                    Console.WriteLine(P2.Getname() + "LOSE");
                    break;
                }

                Console.WriteLine(P2.Getname() + " luot 1 ");
                P1.PickBall(Game);
                if (Game.Gameover())
                {
                    Console.WriteLine(P2.Getname() + "WIN");
                    Console.WriteLine(P1.Getname() + "LOSE");
                    break;
                }
            }
        }