Exemplo n.º 1
0
        public override void MakeMove(ref Board aBoard)
        {
            //Uncomment the below to randomize the list of numbers
            //Random r = new Random();
            //int i = r.Next(8);
            int move = 0;
            //Comment out the below when randomizing the list of numbers
            int i = 0;

            int[] nums = { 4, 0, 2, 6, 8, 1, 3, 5, 7 };  //the list of numbers

            do
            {
                //move is set to the first number of the list, then incremented at each pass
                move = nums[i];
                ++i;

            } while (!aBoard.IsLegalMove(move));
            aBoard.ReceiveMove(GetPiece(), move);
        }
Exemplo n.º 2
0
        public override void MakeMove(ref Board aBoard)
        {
            int move;
            Game theGame = new Game();
            do
            {
                theGame.AskMove(GetPiece());
                string X = Convert.ToString(Console.ReadLine());
                if (X == "")
                {
                    move = Convert.ToInt32("9");
                }
                else
                {
                    move = Convert.ToInt32(int.Parse(X));
                }
            } while (!aBoard.IsLegalMove(move));

            aBoard.ReceiveMove(GetPiece(), move);
        }
 //makes a move on the board
 public void MakeMove(ref Board theBoard, int move)
 {
     theBoard.ReceiveMove(m_Piece, move);
 }