Example #1
0
        public ulong PawnsAbleToDoublePushDown(ulong emptySquares)
        {
            ulong rank5      = 0x000000FF00000000UL;
            ulong emptyRank4 = BitBoardHelper.ShiftNorthOne(emptySquares & rank5) & emptySquares;

            return(this.PawnsAbleToPushUp(emptyRank4));
        }
Example #2
0
        public ulong DoubleUpPushTargets(ulong emptySquares)
        {
            ulong rank4       = 0x00000000FF000000UL;
            ulong singlePushs = this.SingleUpPushTargets(emptySquares);

            return(BitBoardHelper.ShiftNorthOne(singlePushs) & emptySquares & rank4);
        }
Example #3
0
        protected ulong GetFileMask(int file)
        {
            ulong board = 1UL << file;
            int   count = 8;

            while (--count > 0)
            {
                board |= BitBoardHelper.ShiftNorthOne(board);
            }

            return(board);
        }
Example #4
0
        private ulong GetKingMoves(int i, int j)
        {
            int   index      = i * 8 + j;
            ulong initialPos = 1UL << index;

            ulong board = initialPos;

            ulong attacks = BitBoardHelper.ShiftEastOne(board) | BitBoardHelper.ShiftWestOne(board);

            board    = initialPos | attacks;
            attacks |= BitBoardHelper.ShiftNorthOne(board) | BitBoardHelper.ShiftSouthOne(board);
            return(attacks);
        }
Example #5
0
 public ulong PawnsAbleToPushDown(ulong emptySquares)
 {
     return(BitBoardHelper.ShiftNorthOne(emptySquares) & this.board);
 }
Example #6
0
 public ulong SingleUpPushTargets(ulong emptySquares)
 {
     return(BitBoardHelper.ShiftNorthOne(this.board) & emptySquares);
 }
Example #7
0
 // all pawns that are blocked by the opponent's pawns
 public ulong DownRam(PawnBitBoard opponentPawns)
 {
     return(BitBoardHelper.ShiftNorthOne(this.board) & opponentPawns.board);
 }