示例#1
0
        static BishopMoveTable()
        {
            var magicFinder = new MagicFinder(new MTRandom(0));
            MagicMoveTableBuilder builder = new MagicMoveTableBuilder(magicFinder);

            foreach (var(file, rank) in Position.GetAllFilesRanks())
            {
                AddMovesFromSquare(builder, file, rank);
            }

            BishopMoveMagicTable = builder.Build();
        }
示例#2
0
        static PawnDoubleMoveTable()
        {
            DoubleMovesMagicTables = new MagicMoveTable[2];
            var magicFinder = new MagicFinder(new MTRandom(0));

            foreach (var color in new[] { Color.White, Color.Black })
            {
                MagicMoveTableBuilder builder = new MagicMoveTableBuilder(magicFinder);

                foreach (var(file, rank) in Position.GetAllFilesRanks())
                {
                    AddMovesFromSquare(builder, file, rank, color);
                }

                DoubleMovesMagicTables[(int)color] = builder.Build();
            }
        }