Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("We're countin' gators 'n clonin' sheep!");

            Alligator gator = new Alligator(0);

            CountTestApp.GatorCount(gator);

            Sheep babe = new Sheep("Babe", 0);

            CountTestApp.SheepCount(babe);

            Console.WriteLine("Thanks for all your help! I feel real sleepy all of a sudden. . .");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            CountTestApp.Count();

            while (true)
            {
                Console.WriteLine("Would you like to make some more sheep?\n'y' for 'Y'es, anything else for no!");

                string sheepName   = "";
                int    cloneNumber = 0;

                char answer = Console.ReadKey(true).KeyChar;

                if (answer == 'y' || answer == 'Y')
                {
                    Console.Clear();

                    sheepName = Validator.GetString("What is the name of the sheep?", @"^[A-Z][a-z]+$");

                    cloneNumber = Validator.GetNumber("How many should we make? (up too 100)", 1, 100);

                    Console.Clear();

                    Sheep userMade = new Sheep(sheepName);

                    CountUntil.Count(userMade, cloneNumber);

                    Console.WriteLine("\npress anything to continue...");
                    Console.ReadKey(true);
                    Console.Clear();
                }
                else
                {
                    Console.WriteLine("GOODBYE!!");
                    break;
                }
            }


            Console.ReadKey();
        }