Esempio n. 1
0
from animals import Ant, BettaFish, CopperheadSnake, Earthworm, Finch, Gerbil, Mouse, Parakeet, Terrapin, TimberRattlesnake
from behaviors import IDigging, IFlying, IMoving, ISwimming
from containers import DiggerContainer, FlierContainer, MoverContainer, SwimmerContainer

digger_container = DiggerContainer()
flier_container = FlierContainer()
mover_container = MoverContainer()
swimmer_container = SwimmerContainer()

ant = Ant()
betta_fish = BettaFish()
copperhead_snake = CopperheadSnake()
earthworm = Earthworm()
finch = Finch()
gerbil = Gerbil()
mouse = Mouse()
parakeet = Parakeet()
terrapin = Terrapin()
timber_rattlesnake = TimberRattlesnake()

digger_container.add_animal(ant)
digger_container.add_animal(earthworm)
print(digger_container)

flier_container.add_animal(finch)
flier_container.add_animal(parakeet)
print(flier_container)

mover_container.add_animal(copperhead_snake)
mover_container.add_animal(gerbil)
mover_container.add_animal(mouse)
Esempio n. 2
0
from animals import Ant, Betta_Fish, Copperhead, Earthworm, Finch, Gerbil, Mouse, Parakeet, Timber_Rattlesnake, Terrapin
from environments import Subterranean, Sky, Water, Surface

andy = Ant("Andy")
bryan = Betta_Fish("Bryan")
catherine = Copperhead("Catherine")
edy = Earthworm("Edy")
phineas = Finch("Phineas")
gilbert = Gerbil("Gilbert")
mickey = Mouse("Mickey")
paul = Parakeet("Paul")
timmy = Timber_Rattlesnake("Timmy")
terror = Terrapin("Terror")

terrarium = Subterranean("terrarium")
cage = Surface("cage")
fish_bowl = Water("fish_bowl")
aviary = Sky("aviary")

terrarium.Animal.addAnimal(timmy)
terrarium.addAnimal(mickey)
terrarium.addAnimal(edy)
terrarium.addAnimal(catherine)

cage.addAnimal(andy)
cage.addAnimal(gilbert)

fish_bowl.addAnimal(bryan)
fish_bowl.addAnimal(terror)

aviary.addAnimal(paul)
Esempio n. 3
0
from animals import (Ant, BettaFish, Copperhead, EarthWorm, Finch, Gerbil,
                     Mouse, Parakeet, Rattlesnake, Terrapin)
from movements import (IWalk, ISlither, ISwim, IFly, IDig)
from habitats import (Aquarium, FlyCage, Atrium, LandCage, Terrarium,
                      WaterCage)

andy = Ant("Andy", "Fire Red")
barry = BettaFish("Barry", "Blue")
calvin = Copperhead("Calvin", 'Camo')
earl = EarthWorm("Earl", "Mud Brown")
frita = Finch("Frita", "Yellow")
grandpa = Gerbil("Granpa", "Brown")
milton = Mouse("milton", "Orange")
paulina = Parakeet("Paulina", "Purple")
rayray = Rattlesnake("Ray-Ray", "Camo")
tim = Terrapin("Tim", "green")

aqua = Aquarium()
atri = Atrium()
terra = Terrarium()
flyCage = FlyCage()
landCage = LandCage()
waterCage = WaterCage()

#Uncomment by section

#SECTION 1_____________________________________

# #Aquarium adds
# aqua.add_animal(barry)
# aqua.add_animal(tim)
from animals import Ant, BettaFish, Copperhead, Earthworm, Finch, Gerbil, Mouse, Parakeet, Rattlesnake, Terrapin
from environments import diggingEnvironment, flyingEnvironment, swimmingEnvironment, walkingEnvironment

bob = Ant("Bob")
bubbles = BettaFish("Bubbles")
killer = Copperhead("Killer")
jim = Earthworm("Jim")
finch = Finch("Finch")
snickers = Gerbil("Snickers")
jerry = Mouse("Jerry")
flaps = Parakeet("Flaps")
death = Rattlesnake("Death")
terry = Terrapin("Terry")

hills = diggingEnvironment("Hills")
plains = walkingEnvironment("Plains")
lake = swimmingEnvironment("Lake")
aviary = flyingEnvironment("Aviary")

hills.addAnimal(death)
hills.addAnimal(jerry)
hills.addAnimal(jim)
hills.addAnimal(killer)

plains.addAnimal(bob)
plains.addAnimal(snickers)

lake.addAnimal(bubbles)
lake.addAnimal(terry)

aviary.addAnimal(flaps)
Esempio n. 5
0
"""
Animals
    Ants - Dig, walk
    Earthworms - Dig, slither

    Terrapins - Dig, swim, walk
    Betta Fish - swim
"""

earthworm = Earthworm("earthy")
worm = Earthworm("yeah")
terrapin = Terrapin("terror")
timper = TimperRattlesnake("temper")
mouse = Mouse("mousey")
ant = Ant("antsy")
finch = Finch("atticus")
betta = BettaFish("alpha")
copper = CopperheadSnake("tooper")
gerbil = Gerbil("germy")
keet = Parakeet("keet")

cage = IAir("Circus")
land_terrarium = ILand("Sahera")
under_terrarium = IUnderground("Earth")
aquarium = IWater("Sea World")

aquarium.add_animal(terrapin, betta)
under_terrarium.add_animal(ant, earthworm, worm)
land_terrarium.add_animal(gerbil, copper, mouse, timper)
cage.add_animal(finch, keet)
Esempio n. 6
0
ralph = PaintedDog("Ralph")

seaworld = Aquarium("Sea World")
seaworld.add_swimmer_pythonic(bob)
seaworld.add_swimmer_pythonic(ralph)
seaworld.add_swimmer_type_check(ralph)
for animal in seaworld.animals:
    print(f'{animal} lives in Sea World')

print()
# animals needing temporary containers
andy = Ant("Andy")
kristen = Betta("Kristen")
bryan = Copperhead("Bryan")
chase = Earthworm("Chase")
jisie = Finch("Jisie")
ashley = Gerbil("Ashley")
kristin = Mouse("Kristin")
john = Parakeet("John")
jeremiah = Terrapin("Jeremiah")
brenda = TimberRattlesnake("Brenda")
# temporary containers
diggers = Sandbox("Temporary Digger Home")
fliers = Aviary("Temporary Flier Home")
swimmers = Tank("Temporary Swimmer Home")
slitherers = Snakepit("Temporary Snake Home")

diggers.add_digger_type_check(andy)
diggers.add_digger_pythonic(kristen)
diggers.add_digger_type_check(brenda)
diggers.add_digger_type_check(chase)
Esempio n. 7
0
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)
Esempio n. 8
0
from animals import EarthWorms, Terrapins, Rattlesnake, Mice, Ant, Finch, BettaFish, CopperHead, Gerbil, Parakeet
from habitats import IAquarium, ICage, IDirt, IGrassy, IAmazon

earthworm = EarthWorms("WormDude")
terrapin = Terrapins("Terrible")
snake = Rattlesnake("Rattle")
mouse = Mice("MouseBro")
ant = Ant("AntBro")
finch = Finch("FinchBro")
betta = BettaFish("BettaBro")
copperhead = CopperHead("CopperNotBronze")
gerbil = Gerbil("Gerbs")
skeet = Parakeet("SKEET")

cage = ICage("The Bird Trap")
land_container = IGrassy("Land Walkers")
underworld = IDirt("Diggers")
aquarium = IAquarium("ShamooIsNumberOne")
amazon = IAmazon("Slitheren")

cage.add_animal(finch, skeet)
land_container.add_animal(ant, mouse)
underworld.add_animal(earthworm, ant, mouse, gerbil)
aquarium.add_animal(betta)
amazon.add_animal(copperhead, snake)

print(earthworm)
print(terrapin)
print(snake)
print(mouse)
print(ant)