Пример #1
0
        public static void intro()
        {
            bool quit = false;

            do
            {
                Console.WriteLine("******Welcome to the Farm******");
                Console.WriteLine("1. Harry the Horse");
                Console.WriteLine("2. Ted the Turtle");
                Console.WriteLine("3. Pinky the pig");
                Console.WriteLine("4. Daffy the duck");
                Console.WriteLine("5. Ron the farmer");
                var userselection = Console.ReadLine();
                if (userselection == "1")
                {
                    HarryTheHorse.main();
                }
                else if (userselection == "2")
                {
                    TedTheTurtle.main();
                }
                else if (userselection == "3")
                {
                    PinkyThePig.main();
                }
                else if (userselection == "4")
                {
                    DaffyTheDuck.main();
                }
                else if (userselection == "5")
                {
                    Ron.main();
                }
                else
                {
                    Console.WriteLine("Sorry I dont understand your selection");
                    Console.WriteLine("Try again");
                    Console.ReadKey();
                    Console.Clear();
                }
            }while (!quit);
        }
Пример #2
0
        public static void main()
        {
            // main menu 3 options when you select pinky
            Console.Clear();
            Console.WriteLine("-----Pinky the Pig-----");
            Console.WriteLine("1. Talk to");
            Console.WriteLine("2. Feed");
            Console.WriteLine("3. Product info");
            var  userselect1 = Console.ReadLine();
            bool quit        = false;

            //do while loop for option selection
            //  do
            //  {

            if (userselect1 == "1")
            {
                PinkyThePig.speak();
            }
            else if (userselect1 == "2")
            {
                PinkyThePig.feed();
            }
            else if (userselect1 == "3")
            {
                PinkyThePig.product();
            }
            else
            {
                Console.WriteLine("Sorry I dont understand your selection");
                Console.WriteLine("Try again");
                Console.ReadKey();
                Console.Clear();
            }
            //   } while (!quit);
        }