示例#1
0
        private static Line MoveLineLeft(int line)
        {
            var levels = BitBoardHandler.ToLevels((Line)line);

            for (int i = 0; i < 3; ++i)
            {
                int j = i + 1;
                while (j < 4 && levels[j] == 0)
                {
                    ++j;
                }
                if (j >= 4)
                {
                    break;
                }
                if (levels[i] == 0)
                {
                    levels[i] = levels[j];
                    levels[j] = 0;
                    --i;
                }
                else if (levels[i] == levels[j])
                {
                    if (levels[i] != LevelMask)
                    {
                        ++levels[i];
                    }
                    levels[j] = 0;
                }
            }
            return(BitBoardHandler.ToLine(levels));
        }
示例#2
0
        private static void CacheLineScores(int line)
        {
            var levels = BitBoardHandler.ToLevels((Line)line);
            int score  = 0;

            for (int i = 0; i < 4; ++i)
            {
                int level = levels[i];
                if (level >= 2)
                {
                    score += (level - 1) * (1 << level);
                }
            }
            lineScores[line] = score;
        }
示例#3
0
 public void Print()
 {
     BitBoardHandler.Print(BitBoard);
 }
示例#4
0
 private int ToValue(int level)
 {
     return(BitBoardHandler.ToValue(level));
 }