コード例 #1
0
        public void place()
        {
            // To ensure that you can't execute other actions before the place() method.
            testTubePlate.readyForOperation = true;

            // Get input from user about where to place the robot arm and save it to the
            // robot arm's current position.
            try
            {
                currentPosition[0] = loopUntilTrue("x");
                currentPosition[1] = loopUntilTrue("y");
            }
            catch
            {
                LcdScreen.error();
            }

            lcdScreen.showCurrentPosition(currentPosition);
        }
コード例 #2
0
        // A loop to display the program's menu after every completed action path.
        public void run()
        {
            Console.WriteLine(printWelcomeMessage());

            while (running == true)
            {
                displayMenu();
                // Get the action the user wants to perform and run it over a switch statement.
                try
                {
                    int menuChoice = System.Convert.ToInt32(Console.ReadLine());
                    routeAction(menuChoice);
                }
                catch
                {
                    LcdScreen.error();
                }
            }
            Console.WriteLine(printFarewellMessage());
        }