예제 #1
0
        protected void TopRightBottomLeftCheck(DCheck func)
        {
            int lineNr = 0;
            int n      = (size - winLine < 0 ? 1 : size - winLine + 1);

            for (int line = 0; line < n; line++)
            {
                for (int x = line, y = size - 1; x < size && y >= 0; x++, y--)
                {
                    if (func(x, y, lineNr))
                    {
                        return;
                    }
                }
                lineNr++;
            }
            for (int line = 1; line < n; line++)
            {
                for (int x = size - 1 - line, y = 0; x >= 0 && y < size; x--, y++)
                {
                    if (func(x, y, lineNr))
                    {
                        return;
                    }
                }
                lineNr++;
            }
        }
예제 #2
0
        protected void VerticalCheck(DCheck func)
        {
            int lineNr = 0;

            for (int x = 0; x < size; x++)
            {
                for (int y = 0; y < size; y++)
                {
                    if (func(x, y, lineNr))
                    {
                        return;
                    }
                }
                lineNr++;
            }
        }