예제 #1
0
파일: TAnalysis.cs 프로젝트: rwsh/AI-XO
        public TCoords[] ForWin; // Все возможные позиции для выигрыша

        public TFinal()
        {
            ForWin = new TCoords[MaxWin];

            ForWin[0] = new TCoords(new TCoord(0, 0), new TCoord(0, 1), new TCoord(0, 2));
            ForWin[1] = new TCoords(new TCoord(1, 0), new TCoord(1, 1), new TCoord(1, 2));
            ForWin[2] = new TCoords(new TCoord(2, 0), new TCoord(2, 1), new TCoord(2, 2));

            ForWin[3] = new TCoords(new TCoord(0, 0), new TCoord(1, 0), new TCoord(2, 0));
            ForWin[4] = new TCoords(new TCoord(0, 1), new TCoord(1, 1), new TCoord(2, 1));
            ForWin[5] = new TCoords(new TCoord(0, 2), new TCoord(1, 2), new TCoord(2, 2));

            ForWin[6] = new TCoords(new TCoord(0, 0), new TCoord(1, 1), new TCoord(2, 2));
            ForWin[7] = new TCoords(new TCoord(0, 2), new TCoord(1, 1), new TCoord(2, 0));
        }
예제 #2
0
파일: TAnalysis.cs 프로젝트: labvit/AI-XO3
        public TCoords[] ForWin; // Все возможные позиции для выигрыша

        public TFinal()
        {
            ForWin = new TCoords[MaxWin];

            // ForWin[0] = new TCoords(new TCoord(0, 0), new TCoord(0, 1), new TCoord(0, 2));  // --> 1
            // ForWin[1] = new TCoords(new TCoord(1, 0), new TCoord(1, 1), new TCoord(1, 2));
            // ForWin[2] = new TCoords(new TCoord(2, 0), new TCoord(2, 1), new TCoord(2, 2));

            // ForWin[3] = new TCoords(new TCoord(0, 0), new TCoord(1, 0), new TCoord(2, 0)); // --> 2
            // ForWin[4] = new TCoords(new TCoord(0, 1), new TCoord(1, 1), new TCoord(2, 1));
            // ForWin[5] = new TCoords(new TCoord(0, 2), new TCoord(1, 2), new TCoord(2, 2));

            // ForWin[6] = new TCoords(new TCoord(0, 0), new TCoord(1, 1), new TCoord(2, 2));
            // ForWin[7] = new TCoords(new TCoord(0, 2), new TCoord(1, 1), new TCoord(2, 0));

            /////// labvit
            ///
            for (int i = 0; i < cell_count; i++)  // <-- 1
            {
                ForWin[i] = new TCoords();
                for (int j = 0; j < cell_count; j++)
                {
                    ForWin[i].Add(new TCoord(i, j));
                }
            }
            for (int i = 0; i < cell_count; i++)  // <-- 2
            {
                ForWin[i + cell_count] = new TCoords();
                for (int j = 0; j < cell_count; j++)
                {
                    ForWin[i + cell_count].Add(new TCoord(j, i));
                }
            }
            ForWin[2 * cell_count] = new TCoords();
            for (int j = 0; j < cell_count; j++)
            {
                ForWin[2 * cell_count].Add(new TCoord(j, j));
            }

            ForWin[2 * cell_count + 1] = new TCoords();
            for (int j = 0; j < cell_count; j++)
            {
                ForWin[2 * cell_count + 1].Add(new TCoord(j, cell_count - j - 1));
            }

            ///
            /////// end labvit
        }