Пример #1
0
        static void Main(string[] args)
        {
            var leanController = new LeanController();

            Console.WriteLine("Initialize the system: ");
            while (true)
            {
                Console.WriteLine("Enter the capacity: ");
                Console.WriteLine("Press 'q' to exit");
                var input = Console.ReadLine();
                if (input == "q")
                {
                    break;
                }
                var capacity = Int16.Parse(input);
                leanController.AddBlock(capacity);
            }

            leanController.PrintSystem();

            Console.WriteLine("Press Enter to go to next hop: ");
            while (true)
            {
                var input = Console.ReadLine();
                if (input == "")
                {
                    leanController.Update();
                    leanController.PrintSystem();
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            var leanController = new LeanController();

            while (true)
            {
                Console.WriteLine("Press 'a' to add a box");
                var result = Console.ReadLine();
                if (result.Trim().Equals("a"))
                {
                    Console.WriteLine("Enter the capacity: ");
                    var capacity = Int16.Parse(Console.ReadLine());
                    leanController.AddBlock(capacity);
                }

                leanController.PrintSystem();
            }
        }