Beispiel #1
0
        protected void Add(Pattern pattern)
        {
            int lSize = pattern.GetFullBoardSize();

            if (lHashedMoves[lSize] == null)
                lHashedMoves[lSize] = new Dictionary<long, List<int>>();
        }
        protected void Add(Pattern pattern)
        {
            int lSize = pattern.GetFullBoardSize();

            if (lHashedMoves[lSize] == null)
            {
                lHashedMoves[lSize] = new Dictionary <long, List <int> >();
            }
        }
Beispiel #3
0
        protected ZobristHash ComputeZobrist(Pattern pattern, Color color)
        {
            int lSize = pattern.GetFullBoardSize();

            ZobristHash lZobristHash = new ZobristHash();

            for (int x = 0; x < lSize; x++)
                for (int y = 0; y < lSize; y++)
                    switch (pattern.GetCell(x, y))
                    {
                        case 'X': lZobristHash.Delta(color.IsBlack ? Color.Black : Color.White, CoordinateSystem.At(x, y, lSize)); break;
                        case 'O': lZobristHash.Delta(color.IsBlack ? Color.White : Color.Black, CoordinateSystem.At(x, y, lSize)); break;
                    }

            return lZobristHash;
        }
        protected ZobristHash ComputeZobrist(Pattern pattern, Color color)
        {
            int lSize = pattern.GetFullBoardSize();

            ZobristHash lZobristHash = new ZobristHash();

            for (int x = 0; x < lSize; x++)
            {
                for (int y = 0; y < lSize; y++)
                {
                    switch (pattern.GetCell(x, y))
                    {
                    case 'X': lZobristHash.Delta(color.IsBlack ? Color.Black : Color.White, CoordinateSystem.At(x, y, lSize)); break;

                    case 'O': lZobristHash.Delta(color.IsBlack ? Color.White : Color.Black, CoordinateSystem.At(x, y, lSize)); break;
                    }
                }
            }

            return(lZobristHash);
        }