Esempio n. 1
0
        public MoveList Solve(int[] board, int[] pieces, int locationFirstPiece)
        {
            for (var i = 0; i < Constants.NumberOfFields; i++)
            {
                if (board[i] != Constants.Rock)
                {
                    _maximumScore++;
                }
            }

            _currentMoveList = new MoveList(pieces.Length)
            {
                Score = 0
            };

            BestMoveList = new MoveList(pieces.Length)
            {
                Score = 0
            };

            var head = pieces.First();
            var tail = pieces.Skip(1).ToArray();

            //Solve( board, head, tail, 0 );
            DoFirstMove(board, head, tail, 0, locationFirstPiece);
            return(BestMoveList);
        }
Esempio n. 2
0
 public void SetNewBest(MoveList newBest)
 {
     Buffer.BlockCopy(newBest._indices, 0, _indices, 0, _length);
 }