Exemplo n.º 1
0
        static void Main(string[] args)
        {
            bool success = false;
            int  n       = 0;

            Console.Write("Enter day number: ");

            while (!success)
            {
                try
                {
                    success = true;
                    string day = Console.ReadLine();
                    n = Int32.Parse(day);
                }
                catch (Exception e)
                {
                    success = false;
                    Console.Write("\nEnter valid day number: ");
                }
            }

            Console.WriteLine();

            switch (n)
            {
            case 1:
                var data = GetListFromFile(@"..\..\..\Input\Input1.txt");
                Day1.GetResult(data);
                break;
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            bool success = false;
            int  n       = 0;

            while (n < 0)
            {
                n = GetNumberInput("Enter day number or negative number to exit: ");

                switch (n)
                {
                case 1:
                    var n2 = GetNumberInput("Enter task number or negative number to exit: ");
                    if (n2 == 1)
                    {
                        Day1.GetResult1("Input1_1");
                    }
                    else if (n2 == 2)
                    {
                        Day1.GetResult2("Input1_2.txt");
                    }
                    else
                    {
                        global::System.Console.WriteLine("There is not task " + n2 + " in day " + n);
                    }
                    break;
                }
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var lines = File.ReadAllLines(@"..\..\Day1\input.txt");
            var d1    = new Day1(lines);

            d1.Calculate();
            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            DateTime start = DateTime.Now;
            DateTime last  = start;

            Day1.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day2.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day3.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day4.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day5.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day6.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day7.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day8.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day9LinkedList.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day10.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day11.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day12.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day13.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day14.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day15Dijkstra.Run(false, 500);
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day16.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day17.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day18.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day19.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day20.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day21.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day22.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day23.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day24.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Day25.Run();
            Console.WriteLine("Run Time: " + (DateTime.Now - last));
            last = DateTime.Now;
            Console.WriteLine("\nTotal Run Time: " + (DateTime.Now - start));
        }
Exemplo n.º 5
0
        private void btnDay1_Click(object sender, EventArgs e)
        {
            Day1 frm = new Day1();

            frm.Show();
        }