예제 #1
0
        static void Main(string[] args)
        {
            var predatorsForBug1 = new List <string>()
            {
                "Mantis", "Bird"
            };

            predatorsForBug1.Add("Ribbon Snake");

            var preyForBug1 = new List <string>()
            {
                "Tomato", "Bell Pepper"
            };

            preyForBug1.Add("Lettuce");

            var bug1 = new Bug("Bob", "Tomato bug", predatorsForBug1, preyForBug1);

            var predatorsForBug2 = new List <string>()
            {
                "Human", "Frontline"
            };

            var preyForBug2 = new List <string>()
            {
                "Cat", "Dog"
            };

            var bug2 = new Bug("Tilly", "Flea", predatorsForBug2, preyForBug2);

            Console.WriteLine(bug1.Eat("Tomato"));
            Console.WriteLine(bug1.Eat("Celery"));
            Console.WriteLine(bug2.Eat("Dog"));
            Console.WriteLine(bug2.Eat("Mouse"));
        }
예제 #2
0
        static void Main(string[] args)
        {
            Bug bug1 = new Bug("Ladybug", "Insect", new List <string> {
                "Lizard", "spider"
            }, new List <string> {
                "mites", "aphids"
            });

            Console.WriteLine(bug1.FormalName);
            Console.WriteLine(bug1.PreyList());
            Console.WriteLine(bug1.PredatorList());
            Console.WriteLine(bug1.Eat("pizza"));
            Console.WriteLine(bug1.Eat("mites"));
        }
예제 #3
0
        static void Main(string[] args)
        {
            List <string> Predators = new List <string>()
            {
                "Dog",
                "Cat",
                "Lion",
                "Tiger",
                "Bear"
            };

            List <string> Prey = new List <string>()
            {
                "Chow",
                "Mice",
                "Wildebeast",
                "Boar",
                "Honey"
            };

            Bug bug1 = new Bug("Glue", "Stick Bug", Predators, Prey);

            Console.WriteLine(bug1.FormalName);
            Console.WriteLine(bug1.Eat("Elmer's Glue"));
        }
예제 #4
0
        static void Main(string[] args)
        {
            var predator = new List <string> {
                "birds", " frogs"
            };
            var prey = new List <string> {
                "crops", " flowers", " grass"
            };
            var bug = new Bug("buggy", "beetle", predator, prey);

            Console.WriteLine(bug);
            Console.ReadLine();

            Console.WriteLine(bug.FormalName);
            Console.ReadLine();

            Console.WriteLine(bug.PreyList());
            Console.ReadLine();

            Console.WriteLine(bug.PredatorList());
            Console.ReadLine();

            Console.WriteLine(bug.Eat("grass"));
            Console.ReadLine();
        }
예제 #5
0
        static void Main(string[] args)
        {
            List <string> Predators = new List <string>()
            {
                "Shark",
                "Eagle",
                "Lion",
                "Tiger",
                "Hawk"
            };

            List <string> Prey = new List <string>()
            {
                "Fish",
                "Rabbit",
                "Buffalo",
                "Deer",
                "Mice"
            };

            Bug bug1 = new Bug("Yolo", "Ladybug", Predators, Prey);

            Console.WriteLine(bug1.FormalName);
            Console.WriteLine(bug1.Eat("a leaf"));
        }
예제 #6
0
        static void Main(string[] args)
        {
            var preds = new List <string>
            {
                "bats",
                "freakin dinosaurs, man"
            };
            var preys = new List <string>
            {
                "hopes",
                "dreams"
            };
            var nigel = new Bug("Nigel", "LIGHTNING BUG", preds, preys);

            Console.WriteLine($"{nigel.Name} is a {nigel.Species}");
            Console.WriteLine($"What should {nigel.Name} eat? (he likes {nigel.PreyList()})");
            var whatNigelShouldEat = Console.ReadLine();

            Console.WriteLine(nigel.Eat(whatNigelShouldEat));

            var llewellyn = new Bug("Llewellyn", "jitterbug", preys, preds);

            Console.WriteLine($"{llewellyn.Name} is a {llewellyn.Species}");
            Console.WriteLine($"What should {llewellyn.Name} eat? (he likes {llewellyn.PreyList()})");
            var whatLlewellynShouldEat = Console.ReadLine();

            Console.WriteLine(llewellyn.Eat(whatLlewellynShouldEat));
            Console.ReadLine();
        }
예제 #7
0
        static void Main(string[] args)
        {
            var LadyBug = new Bug("LadyBug", "Ladybird Beetle", new List <string> {
                "tree frogs", "parasites"
            }, new List <string> {
                "dragonflies"
            });

            Console.WriteLine(LadyBug.Eat("aphids"));
            Console.ReadLine();
        }
예제 #8
0
        static void Main(string[] args)
        {
            Bug mantis = new Bug("Scyther", "Praying Mantis", new List <string> {
                "Eagle", "Praying Mantis", "Crab"
            }, new List <string> {
                "Praying Mantis", "Beetle", "Ladybug"
            });

            mantis.PreyList();
            mantis.PredatorList();

            Console.WriteLine(mantis.Eat("Praying Mantis"));
        }
예제 #9
0
        static void Main(string[] args)
        {
            var hornedBeetlePredators = new List <string>()
            {
                "click beetles",
                "flat bark beetles",
                "clerid beetles",
                "ambush bugs",
                "thrips",
                "assassin bugs",
                "carpenter ants",
                "wasps"
            };

            var hornedBeetlePrey = new List <string>()
            {
                "birch",
                "chestnut",
                "green ash",
                "maple"
            };

            var mantisPredators = new List <string>()
            {
                "frogs",
                "bats",
                "monkeys",
                "larger birds",
                "spiders",
                "snakes"
            };

            var mantisPrey = new List <string>()
            {
                "lizards",
                "crickets",
                "moths",
                "flies",
                "flour worms",
                "other large insects they can catch"
            };

            var beetle = new Bug("Horned Beetle", "Anoplophora glabripennis", hornedBeetlePredators, hornedBeetlePrey);
            var mantis = new Bug("Dead Leaf Mantis", "Deroplatys desiccata", mantisPredators, mantisPrey);

            Console.WriteLine(beetle.Eat("maple"));
            Console.WriteLine(mantis.Eat("steak"));
            Console.WriteLine($"{mantis.FormalName} loves to eat {mantis.PreyList()}");
            Console.WriteLine($"Take cover {beetle.FormalName}! Here come the {beetle.PredatorList()}");
        }
예제 #10
0
        static void Main(string[] args)
        {
            var catPredators = new List <string>()
            {
                "tiger",
                "lion",
                "panther"
            };

            var catPrey = new List <string>();

            catPrey.Add("mouse");

            var cat = new Bug("house cat", "feline", catPredators, catPrey);

            Console.WriteLine(cat.Eat("kibble"));
            Console.ReadKey();
        }
예제 #11
0
        static void Main(string[] args)
        {
            var myBugsPreds = new List <string>()
            {
                "Pred A", "Pred B", "Pred C"
            };
            var myBugsPrey = new List <string>()
            {
                "Prey A", "Prey B", "Prey C"
            };
            var myBug = new Bug("My Bug", "It's Species", myBugsPreds, myBugsPrey);

            var preyList = myBug.PreyList();
            var predList = myBug.PredatorList();

            Console.WriteLine(preyList);
            Console.WriteLine(predList);

            var prey = "Prey B";

            Console.WriteLine(myBug.Eat(prey));
        }
예제 #12
0
        static void Main(string[] args)
        {
            var predatorsForBug1 = new List <string>()
            {
                "Human", "Raid"
            };

            predatorsForBug1.Add("Dinosaurs");

            var preyForBug1 = new List <string>()
            {
                "Fly",
                "Caterpillar"
            };

            var bug1 = new Bug("Black Widow", "Spider", predatorsForBug1, preyForBug1);

            Console.WriteLine(bug1.PredatorList());
            Console.WriteLine(bug1.PreyList());
            Console.WriteLine(bug1.Eat("Fly"));

            var predatorsForBug2 = new List <string>()
            {
                "Human", "Mouse", "Bat"
            };
            var preyForBug2 = new List <string>()
            {
                "Spiders", "Lizards"
            };

            var bug2 = new Bug("King Scorpio", "scorpion", predatorsForBug2, preyForBug2);

            Console.WriteLine(bug2.PredatorList());
            Console.WriteLine(bug2.PreyList());
            Console.WriteLine(bug2.Eat("Fly"));
        }