Exemple #1
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)
Exemple #2
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)
Exemple #3
0
from animals import Ant, BettaFish, CopperheadSnake, Earthworm, Finch, Gerbil, Mouse, Parakeet, Terrapin, TimberRattlesnake
from containers import Diggers, Movers, Swimmers, Fliers

ant = Ant()
betta = BettaFish()
copperhead = CopperheadSnake()
worm = Earthworm()
finch = Finch()
gerbil = Gerbil()
mouse = Mouse()
parakeet = Parakeet()
terrapin = Terrapin()
timber = TimberRattlesnake()

diggers = Diggers()
movers = Movers()
swimmers = Swimmers()
fliers = Fliers()

diggers.add_animal(ant)
swimmers.add_animal(betta)
movers.add_animal(copperhead)
diggers.add_animal(worm)
fliers.add_animal(finch)
movers.add_animal(gerbil)
movers.add_animal(mouse)
fliers.add_animal(parakeet)
movers.add_animal(terrapin)
movers.add_animal(timber)
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)
Exemple #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)

print(cage, land_terrarium, under_terrarium, aquarium)
Exemple #6
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)
Exemple #7
0
from animals import Penguin, PaintedDog, Copperhead, BettaFish, Parakeet, Earthworm
from habitats import Aquarium, Aviary, Terrestrial, DirtPot

waddles = Penguin("Waddles")
doggy = PaintedDog("Doggy")
wormy = Earthworm("Wormy")
wingsy = Parakeet("Wingsy")
snakey = Copperhead("Snakey")
fishy = BettaFish("Fishy")

wormy.digging()
snakey.slithering()
fishy.swim()
doggy.run()
waddles.run()
waddles.swim()
wingsy.flying()

print(wingsy.__dict__)
print(wormy.__dict__)

seaworld = Aquarium("Sea World")
seaworld.add_swimmer_type_check(waddles)
seaworld.add_swimmer_type_check(fishy)
seaworld.add_swimmer_type_check(snakey)

skyworld = Aviary("Sky World")
skyworld.add_flier_type_check(wingsy)

landworld = Terrestrial("Land World")
landworld.add_walking_type_check(snakey)