Esempio n. 1
0
        public void TestDiagonalMoves1()
        {
            var   boardString = BitBoardHelper.GetEmptyBoardString();
            ulong board       = BitBoardHelper.FromString(boardString);
            var   coords      = Square.A1;

            string moves =
                "00000001" +
                "00000010" +
                "00000100" +
                "00001000" +
                "00010000" +
                "00100000" +
                "01000000" +
                "00000000";
            ulong movesBoard      = BitBoardHelper.FromString(moves);
            var   diagonalAttacks = provider.DiagonalAttacks(coords, board);

            Assert.AreEqual(movesBoard, diagonalAttacks);
        }
Esempio n. 2
0
        public void ClearPosition3()
        {
            var coords = Square.H3;

            string otherFiguresBoard = BitBoardHelper.GetEmptyBoardString();

            string resultBoard =
                "00000001" +
                "00000001" +
                "00000001" +
                "00000001" +
                "00000001" +
                "11111110" +
                "00000001" +
                "00000001";

            ulong otherFigures = BitBoardHelper.FromString(otherFiguresBoard);
            ulong result       = BitBoardHelper.FromString(resultBoard);

            Assert.AreEqual(result,
                            provider.GetAttacks(coords, otherFigures));
        }