def test_cage(): from random import choice, randint sheeps = [Sheep('white'), Sheep('black')] wolves = [Wolf('gray'), Wolf('black'), Wolf('brown'), Wolf('white')] snakes = [Snake('black'), Snake('golden'), Snake('green')] parrots = [Parrot('yello/blue'), Parrot('red')] species = [sheeps, wolves, snakes, parrots] small_cages = [SmallCage(n) for n in range(randint(3, 10))] big_cages = [BigCage(n) for n in range(randint(2, 4))] # -- SMAL CAGE TEST -- for cage in small_cages: for num_animals in range(randint(0, 5)): try: cage.add_animals(choice(choice(species))) except CageFull: pass for cage in small_cages: print(cage) # -- BIG CAGE TEST -- for cage in big_cages: for num_animals in range(randint(7, 12)): try: cage.add_animals(choice(choice(species))) except CageFull: pass for cage in big_cages: print(cage)
miss_fuzz = Llama("Miss Fuzz", "domestic llama", "morning", "Llama Chow" ) mr_fuzz = Goat("Mister Fuzz", "mountain goat", "morning", "Goat Chow") baby_fuzz = Alpaca("Baby Fuzz", "domestic alpaca", "morning", "Alpaca Chow") fancy_fuzz = Pony("Fancy Fuzz", "miniature horse", "morning", "Pony Chow") oink_fuzz = Pig("Oink Fuzz", "domestic pig", "morning", "Pig Chow") # fluffy_village.add_to_list(miss_fuzz) # fluffy_village.add_to_list(mr_fuzz) # fluffy_village.add_to_list(baby_fuzz) # fluffy_village.add_to_list(fancy_fuzz) # fluffy_village.add_to_list(oink_fuzz) ########## sneky = Snake("Sneky", "copperhead", "morning", "Snake Chow") squirt = Turtle("Squirt", "turtle", "morning", "Turtle Chow") lizzie = Lizard("Lizzie", "lizard", "morning", "Lizard Chow") veep = Viper("Veep", "viper", "morning", "Pig Chow") boaz = Boa("Boaz", "boa constrictor", "morning", "Boa Chow") # varmint_village.add_to_list(sneky) # varmint_village.add_to_list(squirt) # varmint_village.add_to_list(lizzie) # varmint_village.add_to_list(veep) # varmint_village.add_to_list(boaz) ############### # thad = Tadpole("Thad", "frog", "morning", "Snake Chow")
"Goat", "grain", ) alfred = Alpaca( "alfred", "Alpaca", "hay", ) larry = Llama( "larry", "Llama", "hay", ) susan = Snake( "susan", "Snake", "pellet", ) lulu = Lizard( "lulu", "Lizard", "pellet", ) tayler = Turtle( "tayler", "Turtle", "fish", ) patty = Parrot( "patty", "Parrot",
from animals import Barreleye, Bird, Catfish, Donkey, Duck, Goat, Goldfish, Insect, King_Cobra, Kingsnake, Llama, Pig, Sheep, Snake, Whale from attractions import Petting_Zoo, Snake_Pit, Wetlands bassy = Barreleye('Bassy', 'fish', 'Morning', 'Fish chips', 12345) cotters = Bird('Cotters', 'shoebill', 'Evening', 'Bird Food') catty = Catfish('Catty', 'catfish', 'Afternoon', 'Fish Chips') dokay = Donkey('Dokay', 'amiatina', 'Morning', 'Donkey food') malaard = Duck('Malaard', 'mallard', 'Evening', 'Duck food') lebron = Goat('Lebron', 'goat', 'Afternoon', 'Goat food') goldie = Goldfish('Goldie', 'goldfish', 'Evening', 'Fish chips') scorpie = Insect('Scorpie', 'scorpion', 'Morning', 'Insect food') moonshine = King_Cobra('Moonshine', 'snake', 'Afternoon', 'Snake food') kingsby = Kingsnake('Kingsby', 'snake', 'Morning', 'Snake food') llavya = Llama('Llavya', 'llama', 'Evening', 'Llama food') pinky = Pig('Pinky', 'Duroc pig', 'Afternoon', 'Pig food') shep = Sheep('Shep', 'sheep', 'Morning', 'Sheep food') anex = Snake('Anex', 'anaconda', 'Evening', 'Snake food') swain = Whale('Swain', 'Humpback', 'Afternoon', 'Whale food') varmint_village = Petting_Zoo("Varmint Village", "Pet all you can!") reptilian_corner = Snake_Pit("Reptilian Corner", "Lots and Lots and Lots of Reptiles") the_wet_place = Wetlands("The Wet Place", "It's wet here.") varmint_village.add_animals( [dokay, cotters, malaard, lebron, llavya, pinky, shep, swain]) reptilian_corner.add_animals([scorpie, moonshine, kingsby, anex]) the_wet_place.add_animals([catty, goldie, swain]) print(the_wet_place)
from animals import Parakeet, Earth_Worm, Terrapin, Snake, Mouse, Ant, Finch, Fish, Copperhead, Gerbil from habitats import Aquarium, Bird_House, Dirt_Pile, Yard parakeet = Parakeet('parry') worm = Earth_Worm('wormy') turtle = Terrapin('terry') snake = Snake('snake') mouse = Mouse('mickey') ant = Ant('Anty') finch = Finch('finchy') betta = Fish('fishy') Copperhead = Copperhead('coppy') gerbil = Gerbil("gerry") aquarium = Aquarium("aquarium") bird_house = Bird_House("birdville") dirty = Dirt_Pile('dirty') yard = Yard('yard') aquarium.add_animal(betta) print(aquarium)
from animals import Goose, Alligator, Alpaca, Bird, Donkey, Duck, Fish, Frog, Goat, Lizard, Llama, Pig, Snake, Toad, Tortoise, Turtle from attractions import PettingZoo, SnakePit, Wetlands barbara = Llama("Barbara", "Domestic Llama", "morning", "Llama Chow", 12345) kong = Donkey("Kong", "African Wild Ass", "midday", "Donkey Chow", 12346) tom_brady = Goat("Tom Brady", "Wild Goat", "afternoon", "Goat Chow", 12347) fluffy = Alpaca("Fluffy", "Domestic Alpaca", "morning", "Alpaca Chow", 12348) porky = Pig("Porky", "Pot Belly Pig", "midday", "Pig Chow", 12349) bertha = Snake("Bertha", "Green Anaconda", "Snake Chow", 23456) jose = Lizard("Jose", "Mexican Beaded Lizard", "afternoon", "Lizard Chow", 23457) wayne = Tortoise("Wayne", "Galapagos Tortoise", "morning", "Tortoise Chow", 23458) michelangelo = Turtle("Michelangelo", "Teenage Mutant Ninja Turtle", "midday", "Turtle Chow", 23459) chompy = Alligator("Chompy", "American Alligator", "afternoon", "Alligator Chow", 34567) nemo = Fish("Nemo", "Clown Fish", "Fish Chow", 34568) miss_blue = Bird("Miss Blue", "Great Blue Turaco", "morning", "Bird Chow", 34569) frogger = Frog("Frogger", "Green Frog", "midday", "Frog Chow", 45678) mr_toad = Toad("Mr. Toad", "Common Toad", "afternoon", "Toad Chow", 45679)
from animals import Lizard, Donkey, Llama, Frog, Goat, Snake, Duck, Fish, Bull, Pigeon, Stork, Rabbit, Snail, Parakeet, Rhino from attractions import PettingZoo, SnakePit, Wetlands kenny = Lizard('Kenny', 'lizard', 'manflesh', 69420) jenny = Donkey('Jenny', 'donkey', 'midnight', 'manflesh', 1337) penny = Llama('Penny', 'llama', 'dusk', 'manflesh', 808) benny = Frog('Benny', 'frog', 'manflesh', 8675309) lenny = Goat('Lenny', 'goat', 'dusk', 'manflesh', 123) vinny = Snake('Vinny', 'snake', 'mouseflesh', 324) connie = Duck('Connie', 'duck', 'dawn', 'gooseflesh', 909) johnny = Fish('Johnny', 'fish', 'fishflesh', 9) ronnie = Bull('Ronnie', 'bull', 'midnight', 'manflesh', 1011) lonny = Pigeon('Lonny', 'pigeon', 'anything', 666) yonni = Stork('Yonni', 'stork', 'fishflesh', 2244) donnie = Rabbit('Donnie', 'rabbit', 'dusk', 'carrotflesh', 42) bonnie = Snail('Bonnie', 'snail', 'unknown', 1307) keeter = Parakeet('Keeter', 'parakeet', 'snailflesh', 789) reeter = Rhino('Reeter', 'rhino', 'dusk', 'manflesh', 2) eatin_good = PettingZoo('Eatin Good') baller_crawler = SnakePit('Baller Crawler') wetty_already = Wetlands('Wetty Already') eatin_good.addAnimals(jenny, penny, lenny, ronnie, donnie, reeter) baller_crawler.addAnimals(kenny, benny, vinny, bonnie) wetty_already.addAnimals(connie, johnny, lonny, yonni, keeter) for animal in eatin_good.animals: print( f"{animal.name} is a good {animal.species} in {eatin_good.attraction_name}" )