예제 #1
0
파일: Program.cs 프로젝트: zapu/Algenhax
        static void AlgenMain()
        {
            try
            {
                Algen alg = new Algen();
                alg.init();

                Console.WriteLine("Co enumerujemy? 1 - krzyzowanie, 2 - mutacje");
                int            en = 0;
                ConsoleKeyInfo a  = Console.ReadKey();
                switch (a.KeyChar)
                {
                case '1':
                    break;

                case '2':
                    en = 1;
                    break;

                default:
                    Console.WriteLine("huh?");
                    return;
                }

                foreach (double val in enumerujDoubla())
                {
                    if (en == 0)
                    {
                        alg.setKrzyzowania(Math.Round(val, 2).ToString().Replace(',', '.'));
                    }
                    else
                    {
                        alg.setMutacji(Math.Round(val, 2).ToString().Replace(',', '.'));
                    }

                    Thread.Sleep(50); // We probably don't need sleep here...

                    alg.sendStart();

                    Thread.Sleep(600);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: zapu/Algenhax
        static void AlgenMain()
        {
            try
            {
                Algen alg = new Algen();
                alg.init();

                Console.WriteLine("Co enumerujemy? 1 - krzyzowanie, 2 - mutacje");
                int en = 0;
                ConsoleKeyInfo a = Console.ReadKey();
                switch (a.KeyChar)
                {
                    case '1':
                        break;
                    case '2':
                        en = 1;
                        break;
                    default:
                        Console.WriteLine("huh?");
                        return;
                }

                foreach (double val in enumerujDoubla())
                {
                    if (en == 0)
                        alg.setKrzyzowania(Math.Round(val, 2).ToString().Replace(',', '.'));
                    else
                        alg.setMutacji(Math.Round(val, 2).ToString().Replace(',', '.'));

                    Thread.Sleep(50); // We probably don't need sleep here...

                    alg.sendStart();

                    Thread.Sleep(600);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }