Exemple #1
0
        static void Main(string[] args)
        {
            // make animals
            Skunk   skunk   = new Skunk();
            Weasel  weasel  = new Weasel();
            Bear    bear    = new Bear();
            Lion    lion    = new Lion();
            Wolf    wolf    = new Wolf();
            Narwhal narwhal = new Narwhal();
            Dolphin dolphin = new Dolphin();
            Orca    orca    = new Orca();

            // make dinner
            IAmDinner rat      = new OtherEdibleCritters();
            IAmDinner mole     = new OtherEdibleCritters();
            IAmDinner guppy    = new OtherEdibleCritters();
            IAmDinner salmon   = new OtherEdibleCritters();
            IAmDinner tuna     = new OtherEdibleCritters();
            IAmDinner sturgeon = new OtherEdibleCritters();
            IAmDinner bass     = new OtherEdibleCritters();

            // setting the stage
            Console.WriteLine("Chaos at the zoo!  All of the enclosures have been torn down by angry environmentalists, and the animals are out of control!");

            // skunk eats mole and births 3 babies
            Console.WriteLine("");
            skunk.Eat(mole);
            skunk.GiveBirth(3);

            // weasel eats rat and births 6 babies
            Console.WriteLine("");
            weasel.Eat(rat);
            weasel.GiveBirth(6);

            // lion and wolf each feast at the newly stocked weasel buffet
            Console.WriteLine("");
            lion.Eat(weasel);
            wolf.Eat(weasel);

            // wolf is expecting, so she also eats a bass
            Console.WriteLine("");
            wolf.Eat(bass);
            wolf.GiveBirth(3);

            // lion also had some buns in the oven
            Console.WriteLine("");
            lion.GiveBirth(4);

            // bear went out for dinner, and then went home to have babies and a nap
            Console.WriteLine("");
            bear.Travel();
            bear.Eat(salmon);
            bear.Travel();
            bear.GiveBirth(1);

            // meanwhile, in the water, everyone had babies!
            Console.WriteLine("");
            narwhal.GiveBirth(1);
            orca.GiveBirth(1);
            dolphin.GiveBirth(1);

            // ...and got hungry
            Console.WriteLine("");
            narwhal.Eat(guppy);
            dolphin.Eat(sturgeon);
            orca.Eat(narwhal);
            orca.Eat(dolphin);

            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hipopótamo");
            Hippo hippo = new Hippo();

            hippo.Name = "Hipopótamo";
            hippo.Food = "50k de grama";
            hippo.MakeNoise();
            hippo.Eat();
            hippo.Sleep();
            hippo.Roam();

            SaltarLinhas();

            Console.WriteLine("Felinos");

            SaltarLinhas();
            Console.WriteLine("Tigre");
            Tiger tiger = new Tiger();

            tiger.Name = "Tigre";
            tiger.Food = "30k de carne";
            tiger.MakeNoise();
            tiger.Eat();
            tiger.Sleep();
            tiger.Roam();

            SaltarLinhas();
            Console.WriteLine("Leão");
            Lion lion = new Lion();

            lion.Name = "Leão";
            lion.Food = "30k de carne";
            lion.MakeNoise();
            lion.Eat();
            lion.Sleep();
            lion.Roam();

            SaltarLinhas();
            Console.WriteLine("Gato");
            Cat cat = new Cat();

            cat.Name = "Gato";
            cat.Food = "5k de carne";
            cat.MakeNoise();
            cat.Eat();
            cat.Sleep();
            cat.Roam();

            SaltarLinhas();

            Console.WriteLine("Caninos");

            SaltarLinhas();
            Console.WriteLine("Cachorro");
            Dog dog = new Dog();

            dog.Name = "Cachorro";
            dog.Food = "10k de ração";
            dog.MakeNoise();
            dog.Eat();
            dog.Sleep();
            dog.Roam();

            SaltarLinhas();
            Console.WriteLine("Lobo");
            Wolf wolf = new Wolf();

            wolf.Name = "Cachorro";
            wolf.Food = "10k de ração";
            wolf.MakeNoise();
            wolf.Eat();
            wolf.Sleep();
            wolf.Roam();

            Console.ReadKey();
        }