Exemplo n.º 1
0
        /// <summary>
        /// Builds the transformation matrix.
        /// </summary>
        /// <returns></returns>
        private static int[,] BuildTransformationMatrix()
        {
            int[,] lMatrix = new int[8, 8];

            Coordinate lCoordinate = new Coordinate(1, 2);

            for (int t1 = 0; t1 < 8; t1++)
            {
                for (int t2 = 0; t2 < 8; t2++)
                {
                    Coordinate lCoordinate2 = lCoordinate.Transform(t1).Transform(t2);

                    for (int t3 = 0; t3 < 8; t3++)
                    {
                        if (lCoordinate == lCoordinate2.Transform(t3))
                        {
                            lMatrix[t1, t2] = t3;
                            break;
                        }
                    }
                }
            }

            return(lMatrix);
        }
Exemplo n.º 2
0
        public static string ToVariableDFA(Pattern pattern, int transform)
        {
            StringBuilder lDFA    = new StringBuilder(200);
            Coordinate    lSpiral = new Coordinate(0, 0);

            int lArea = pattern.Width * pattern.Height;

            while (lArea > 0)
            {
                Coordinate p = pattern.Origin + lSpiral.Transform(transform);
                lSpiral.SpiralNext();

                lDFA.Append(pattern.GetVariable(p));

                if (pattern.IsInPattern(p))
                {
                    lArea--;
                }
            }

            return(lDFA.ToString().TrimEnd());
        }
Exemplo n.º 3
0
        public static string ToVariableDFA(Pattern pattern, int transform)
        {
            StringBuilder lDFA = new StringBuilder(200);
            Coordinate lSpiral = new Coordinate(0, 0);

            int lArea = pattern.Width * pattern.Height;

            while (lArea > 0)
            {
                Coordinate p = pattern.Origin + lSpiral.Transform(transform);
                lSpiral.SpiralNext();

                lDFA.Append(pattern.GetVariable(p));

                if (pattern.IsInPattern(p))
                    lArea--;
            }

            return lDFA.ToString().TrimEnd();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Builds the transformation matrix.
        /// </summary>
        /// <returns></returns>
        private static int[,] BuildTransformationMatrix()
        {
            int[,] lMatrix = new int[8, 8];

            Coordinate lCoordinate = new Coordinate(1, 2);

            for (int t1 = 0; t1 < 8; t1++)
                for (int t2 = 0; t2 < 8; t2++)
                {
                    Coordinate lCoordinate2  = lCoordinate.Transform(t1).Transform(t2);

                    for (int t3 = 0; t3 < 8; t3++)
                        if (lCoordinate == lCoordinate2.Transform(t3))
                        {
                            lMatrix[t1, t2] = t3;
                            break;
                        }

                }

            return lMatrix;
        }