On 4/21/06, kirby urner <[EMAIL PROTECTED]> wrote:
> Here's some working code except there's something not yet right -- no
> fox is eating a bunny yet. I haven't figured out why.
>
[snip]
> class Fox (Mammal):
>
# add the following (I think :-)
def update(self):
Mammal.update(self)
self.eat()
> def eat(self):
> for bunny in self.eco.bunnies.values():
> if (self.xpos == bunny.xpos) and (self.ypos == bunny.ypos):
> self.stomach.append( bunny )
> bunny.iseaten(self)
>
> def die(self):
> print '%s dies of old age.' % self
>
> def __repr__(self):
> return 'Fox %s age: %s @ (%s, %s)' % (self.name, self.clock,
> self.xpos, self.ypos)
>
[snip]
André
_______________________________________________
Edu-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/edu-sig