Ejemplo n.º 1
0
        public static void Playing()
        {
            CheckersLogic Board = new CheckersLogic(8);

            // Board.PrintBoard();

            Board.PlayingVessel("Ac>Bd"); // Bf>Ce
            Board.PlayingVessel("Bf>Ce");
            Board.PlayingVessel("Cc>Dd");
            Board.PlayingVessel("Hf>Ge");
            Board.PlayingVessel("Dd>Ee");
            Board.PlayingVessel("Df>Fd");
            Board.PlayingVessel("Ec>Dd");
            Board.PlayingVessel("Fd>Ec");
            Board.PlayingVessel("Bb>Cc");
            //Board.PlayingVessel("Ce>Ec"); // didnt work and it is Good!!!
            Board.PlayingVessel("Ce>Ac");
            Board.PlayingVessel("Ca>Bb");
            Board.PlayingVessel("Ac>Ca"); // should become to King by number 1King(3), 2King(4)
            Board.PlayingVessel("Dd>Ce");
            Board.PlayingVessel("Ca>Bb");
            Board.PlayingVessel("Ce>Bf");
            Board.PlayingVessel("Ff>Ee");
            Board.PlayingVessel("Cc>Bd");
            Board.PlayingVessel("Ag>Ce");
            Board.PlayingVessel("Ce>Ac");
            Board.PlayingVessel("Db>Fd");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            // -- from  here to
            //Board.PlayingVessel("Db>Fd");
            //Board.PlayingVessel("Cg>Df");
            //Board.PlayingVessel("Fd>Ee");
            //Board.PlayingVessel("Bb>Ac");
            //Board.PlayingVessel("Gc>Hd");
            //Board.PlayingVessel("Ff>Dd");
            // -- to here its just to see if all work back and front eating.
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");
            //Board.PlayingVessel("");

            //Board.PrintBoard();

            string str = Console.ReadLine();

            while (char.ToUpper(str[0]) != 'Q')
            {
                Board.PlayingVessel(str);
                Board.PrintBoard();
                str = Console.ReadLine();
            }
        }
Ejemplo n.º 2
0
        // yosi start
        public GamePlay(Player i_player1, Player i_player2, byte i_Size = 8)
        {
            m_player1 = i_player1;
            m_player2 = i_player2;


            m_Size       = i_Size;
            m_ActiveGame = new CheckersLogic(i_Size);
            m_UiOfGame   = new BordToGame(i_Size);
        }
Ejemplo n.º 3
0
 public GamePlay(byte i_Size = 8)
 {
     //yosi start
     m_player1      = new Player();
     m_player2      = new Player();
     m_player1.Name = "avi";
     //yosi end
     m_Size       = i_Size;
     m_ActiveGame = new CheckersLogic(i_Size);
     m_UiOfGame   = new BordToGame(i_Size);
 }
Ejemplo n.º 4
0
        // yosi end

        public static void PlayingTestLogic()
        {
            CheckersLogic Board = new CheckersLogic(8);

            Board.PrintBoard();

            string str = Console.ReadLine();

            while (char.ToUpper(str[0]) != 'Q')
            {
                Board.PlayingVessel(str);
                Board.PrintBoard();
                str = Console.ReadLine();
            }
        }
Ejemplo n.º 5
0
        public static void Playing2()
        {
            Console.Title = "Damka , Good Luck";

            CheckersLogic Board = new CheckersLogic(8);

            Board.PlayingVessel("Ac>Bd"); // Bf>Ce
            Board.PlayingVessel("Bf>Ce");
            Board.PlayingVessel("Cc>Dd");
            Board.PlayingVessel("Hf>Ge");
            Board.PlayingVessel("Dd>Ee");
            Board.PlayingVessel("Df>Fd");
            Board.PlayingVessel("Ec>Dd");
            Board.PlayingVessel("Fd>Ec");
            Board.PlayingVessel("Bb>Cc");

            Board.PlayingVessel("Gg>Hf");
            Board.PlayingVessel("Aa>Bb");
            Board.PlayingVessel("Fh>Gg");


            //// ------- Multi eat
            Board.PlayingVessel("Db>Fd");
            Board.PlayingVessel("Ge>Ec");
            Board.PlayingVessel("Gc>Hd");
            Board.PlayingVessel("Hf>Ge");
            Board.PlayingVessel("Bd>Df");
            //// ------ end.

            //Board.PlayingVessel("");
            //Board.PlayingVessel("");

            Board.PrintBoard();



            string str = Console.ReadLine();

            while (char.ToUpper(str[0]) != 'Q')
            {
                Board.PlayingVessel(str);
                Board.PrintBoard();
                str = Console.ReadLine();
            }
        }
Ejemplo n.º 6
0
        private void moveInBoard(string i_MoveInString)
        {
            const char emptyPlace = ' '; // check to naming
            char       yaadX = i_MoveInString[3], yaadY = i_MoveInString[4], makorX = i_MoveInString[0], makorY = i_MoveInString[1];

            m_UiOfGame[yaadY, yaadX]   = m_UiOfGame[makorY, makorX];
            m_UiOfGame[makorY, makorX] = emptyPlace;

            if (m_ActiveGame.IsEated)
            {
                char MiddleX = (char)((yaadX + makorX) / 2), MiddleY = (char)((yaadY + makorY) / 2);
                m_UiOfGame[MiddleY, MiddleX] = emptyPlace;
            }

            byte indexDestX, indexDestY;

            CheckersLogic.charsToIndex(out indexDestX, yaadX, out indexDestY, yaadY);

            if (m_ActiveGame.checkIfBecomeKing(indexDestX, indexDestY))
            {
                const char xKing = 'K', oKing = 'U';
                m_UiOfGame[yaadY, yaadX] = indexDestY == 0 ? xKing : oKing;
            }
        }
Ejemplo n.º 7
0
 public GamePlay(byte i_Size = 8)
 {
     m_ActiveGame = new CheckersLogic(i_Size);
     m_UiOfGame   = new BordToGame(i_Size);
 }
Ejemplo n.º 8
0
        private void multiEatingByPlayer(string i_MoveInString)
        {
            byte indexX, indexY;


            CheckersLogic.charsToIndex(out indexX, i_MoveInString[3], out indexY, i_MoveInString[4]);

            while (m_ActiveGame.checkingBounderis(indexX, indexY))
            {
                m_UiOfGame.PrintBoardGame();
                Console.WriteLine("Eat Again , From GamePlay !!");

                if (m_ActiveGame.NowPlaying == player1)
                {
                    // replace that
                    i_MoveInString = InputChecking();
                    // i_MoveInString = matricxChekers.AiForDamka.TheMoveToDoForMultiEating(m_ActiveGame, i_MoveInString);
                }
                else
                {
                    if (m_player2.Name == null)
                    {
                        i_MoveInString = matricxChekers.AiForDamka.TheMoveToDoForMultiEating(m_ActiveGame, i_MoveInString);
                    }
                    else
                    {
                        // replace that
                        i_MoveInString = InputChecking();
                        //  i_MoveInString = matricxChekers.AiForDamka.TheMoveToDoForMultiEating(m_ActiveGame, i_MoveInString);
                    }
                }

                if (i_MoveInString != null)
                {
                    byte inputIndex2X, inputIndex2Y, inputIndex1X, inputIndex1Y;
                    CheckersLogic.charsToIndex(out inputIndex2X, i_MoveInString[3], out inputIndex2Y, i_MoveInString[4]);
                    CheckersLogic.charsToIndex(out inputIndex1X, i_MoveInString[0], out inputIndex1Y, i_MoveInString[1]);

                    if (indexX == inputIndex1X && indexY == inputIndex1Y)
                    {
                        Console.WriteLine("Hey im here , the same as befor is playing");
                        m_ActiveGame.eatWithSameSoilder(inputIndex1X, inputIndex1Y, inputIndex2X, inputIndex2Y);
                        Console.WriteLine("answer if it eated the soidler ===> {0}", m_ActiveGame.IsEated);

                        if (m_ActiveGame.IsEated)
                        {
                            moveInBoard(i_MoveInString);

                            indexX = inputIndex2X;
                            indexY = inputIndex2Y;
                        }
                    }

                    //    m_ActiveGame
                }
            }
            // check it
            if (m_ActiveGame.GameOn() == false)
            {
                m_UiOfGame.PrintBoardGame();
            }
        }