Python 2.2 (#1, May 14 2002, 18:23:13)
[GCC 2.95.3 20010315 (SuSE)]
PyShell 1.3
[In 1]:
import turtle as t
[Out 1]:
[In 2]:
from Sketch import Point
[Out 2]:
[In 7]:
class MSystem:
mice = [Point(0,0), Point(100, 100), Point(200,0)]
def draw(self):
for mouse in self.mice:
t.goto(mouse)
t.goto(self.mice[0])
def step(self):
self.draw()
mice = self.mice[:]
mice.append(mice[0])
for i in range(len(mice)-1):
v = mice[i+1]-mice[i]
v = 0.1*v
self.mice[i] = mice[i]+v
def steps(self, n):
for i in range(n):
self.step()
[Out 7]:
[In 8]:
t.create_pen(doc)
doc.SelectNone()
m = MSystem()
[Out 8]:
[In 9]:
m.steps(10)
[Out 9]:
>