Esempio n. 1
0
from animals import Animal
from farm import Farm

gekko = Animal()
python = Animal()
dog = Animal()
cat = Animal()
frog = Animal()

frog.play()
frog.play()
frog.play()
frog.play()

new_farm = Farm()

new_farm.add(gekko)
new_farm.add(python)
new_farm.add(cat)
new_farm.add(frog)
new_farm.add(dog)
new_farm.breed()

new_farm.slaughter()
Esempio n. 2
0
from farm import Farm
from allat import Allat

allatFarm = Farm(5)

tigris = Allat()
malac = Allat()
allatFarm.add(tigris)
allatFarm.add(malac)
allatFarm.breed()  # uj random allat
print(allatFarm.allatok)

print(tigris.lekerEhseg())
print(malac.lekerEhseg())

malac.eszik()
print(malac.lekerEhseg())

allatFarm.slaughter()

print(allatFarm.allatok)