Exemplo n.º 1
0
Arquivo: test.py Projeto: lhcwm/note
import eagle
import ostrich

e = eagle.Eagle('小鹰', 10000, '兔子', 100)
e.eat()
e.fly()
e.rep()

print('------------------')

o = ostrich.Ostrich('小鸵', 0.1, '虫子', 500)
o.eat()
o.fly()
o.rep()
Exemplo n.º 2
0
import eagle
import ostrich
# import bird

ea = eagle.Eagle('大鹰', '公', 50.0, 5)
os = ostrich.Ostrich('鸵鸟', '母', 0.0, 3, 50.5)

if __name__ == '__main__':
    ea.eat_()
    ea.fly_()
    ea.reproduction_()

    print('\n-------------------\n')

    os.eat_()
    os.fly_()
    os.run_()
    os.reproduction_()
Exemplo n.º 3
0
import eagle
import ostrich

a = eagle.Eagle('老鹰')
a.eat()
a.fly()
a.reproduction()
print("------------------------------")
b = ostrich.Ostrich("鸵鸟")
b.fly()
b.eat()
b.reproduction()
Exemplo n.º 4
0
import eagle
import ostrich

eag = eagle.Eagle('老鹰', '兔子', 20, 3)
eag.eat()
eag.wing()
eag.fly()
eag.reproduction()

ost = ostrich.Ostrich('鸵鸟', '杂草', 0, 20)
ost.eat()
ost.neck()
ost.fly()
ost.reproduction()