static void Main(string[] args)
        {
            string[,] QP = new string[17, 17];                                             //定义二维数组QP同时设置棋盘大小 
            while (true)
            {
                Console.Clear();
                int left = 16;
                int top = 8;
                for (int i = 0; i < QP.GetLength(0); i++)
                {
                    for (int j = 0; j < QP.GetLength(1); j++)                             //为数组QP每个元素赋初值   用“□”代替棋盘网格          
                    {
                        QP[i, j] = "□";
                    }
                }
                for (int i = 0; i < QP.GetLength(0); i++)
                {
                    for (int j = 0; j < QP.GetLength(1); j++)
                    {
                        Console.Write(QP[i, j]);                                          //遍历数组QP 并将其打印在窗体 使界面看起来像是网格状
                    }
                    Console.WriteLine();
                }
                bool  = true;
                bool J = true;
                while (J)
                {
                    Console.SetCursorPosition(left, top);                               //设置光标初始位置
                    ConsoleKey key = Console.ReadKey(true).Key;                         //读取输入值
                    switch (key)                                                        //switch语句控制光标的移动,上下左右共4个方向 可同时由方向键和“W”“S”“A”“D”2组组合键控制
                    {
                        case ConsoleKey.UpArrow:
                        case ConsoleKey.W:
                            if (top > 0)
                            {
                                top--;
                            }
                            break;
                        case ConsoleKey.DownArrow:
                        case ConsoleKey.S:
                            if (top < 16)
                            {
                                top++;
                            }
                            break;
                        case ConsoleKey.LeftArrow:
                        case ConsoleKey.A:
                            if (left > 0)
                            {
                                left = left - 2;
                            }
                            break;
                        case ConsoleKey.RightArrow:
                        case ConsoleKey.D:
                            if (left < 32)
                            {
                                left = left + 2;
                            }
                            break;
                        default:                                                       //默认值设置 当按件不为定义的2组组合键时,若当前光标位置不是“□”,则不能操作,
                            if (QP[top, left / 2] != "□")                             //若是“□”,则判断值,为ture则打印"●",否则打印"○",同时数组相应位置的值发声替换
                            {
                                continue;                                               //以实现两种棋子交替出现
                            }
                            if ()
                            {
                                Console.ForegroundColor = ConsoleColor.Blue;
                                Console.Write("●");
                                QP[top, left / 2] = "●";
                            }
                            else
                            {
                                Console.Write("○");
                                QP[top, left / 2] = "○";
                            }
                            if (SF(QP, top, left / 2))       //调用SF方法 判断输赢
                            {
                                J = false;
                                Console.Beep();
                                System.Threading.Thread.Sleep(2000);
                            }
                             = !;
                            break;
                    }
                }
            }
        }
        static bool SF(string[,] strarr, int x, int y)                          //自定义SF方法  判断获胜玩家
        {
            int xx = x;
            int yy = y;
            string ActChe = strarr[x, y];
            int i = 1;                                                          //i表示目前相连的同色棋子数 默认为1
            //第一种情况,x不动,y在变化  即判断y方向上是否获胜
            while (true)
            {
                if (--yy >= 0)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            xx = x;
            yy = y;
            while (true)
            {
                if (++yy < 17)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }            //第二种情况,y不动,x在变化
            i = 1;
            xx = x;
            yy = y;
            while (true)
            {
                if (--xx >= 0)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            xx = x;
            yy = y;
            while (true)
            {
                if (++xx < 17)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            //第三种情况,x,y同增同减
            i = 1;
            xx = x;
            yy = y;
            while (true)
            {
                if (--xx >= 0 && --yy >= 0)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            xx = x;
            yy = y;
            while (true)
            {
                if (++xx < 17 && ++yy < 17)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }            //第四种情况 x加,y减,或y加,x减
            i = 1;
            xx = x;
            yy = y;
            while (true)
            {
                if (--xx >= 0 && ++yy < 17)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            xx = x;
            yy = y;
            while (true)
            {
                if (++xx < 17 && --yy > 0)
                {
                    if (ActChe == strarr[xx, yy])
                    {
                        i++;
                        if (i == 5)
                        {
                            return true;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            return false;
        }加红色的 在代码起什么作用