static void Main(string[] args)
        {
            if (args.Length > 0 && args[0] == "-t")
            {
                TestTime();
                Console.WriteLine("TESTING COMPLETED");
                Console.ReadKey();
                return;
            }

            if (args.Length > 0 && args[0] == "-rt")
            {
                TestTree();
                Console.WriteLine("TESTING COMPLETED");
                Console.ReadKey();
                return;
            }

            string a, b;

            Console.Write("Первая строка: ");
            a = Console.ReadLine();
            Console.Write("Вторая строка: ");
            b = Console.ReadLine();

            Console.WriteLine("\nРезультат: \n");

            foreach (StringDistance.Measure measure in Enum.GetValues(typeof(StringDistance.Measure)))
            {
                StringDistance distance = StringDistance.StringDistanceBuilder.GetInstance(measure, a, b);

                if (distance == null)
                {
                    continue;
                }

                System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();


                GC.Collect();

                stopwatch.Start();

                int result = distance.GetDistance();

                stopwatch.Stop();

                LetterMatrix matrix = distance.GetLetterMatrix();
                Console.WriteLine("Метод: " + distance.MethodName);
                Console.WriteLine("Значение: " + result);
                Console.WriteLine("Матрица: ");
                Console.Write(matrix.ToString());

                Console.WriteLine("Прошло времени (тиков): " + stopwatch.ElapsedTicks);
                Console.WriteLine("Прошло времени (секунд): " + stopwatch.ElapsedMilliseconds / 1000f);
                Console.WriteLine("\n");
            }

            Console.ReadKey();
        }
Exemple #2
0
            public Block(LetterMatrix matrix)
            {
                this.matrix = matrix;

                blockO        = new GameObject().transform;
                blockO.parent = matrix.npc.oTransform;
                float shift = 0;

                foreach (Block b in matrix.blocks)
                {
                    shift += b.size;
                }
                blockO.localPosition = new Vector3(0, -shift, 0);
                blockO.rotation      = matrix.npc.oTransform.rotation;

                lines = new List <Line>();

                size = 0;
            }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     letterMatrix        = new LetterMatrix(this);
     npcUpdateContainer += UpdateWP;
 }