זכויות יוצרים - פעילות המקור לקוחה מהקישור
turtle.done() מניעת סגירת החלון
import turtle
t = turtle.Turtle()
t.fd(100)
turtle.done()
import turtle
t = turtle.Turtle()
turtle.done()
import turtle
t = turtle.Turtle()
for i in range(11):
t.write(i)
t.fd(20)
turtle.done()
import turtle
t = turtle.Turtle()
t.goto(-140,140)
for i in range(11):
t.write(i)
t.fd(20)
turtle.done()
for i in range(11):
t.write(i)
t.fd(20) התקדמות לקו הבא
import turtle
t = turtle.Turtle()
t.pu()
t.goto(-140,140)
t.pd()
t.write(i)
t.rt(90)
t.pu()
t.fd(10)
t.pd()
t.fd(150)
t.pu()
t.bk(160)
t.lt(90)
t.fd(20)
turtle.done()
import turtle
turtle.done()
t1 = turtle.Turtle()
t1.color('#%06x' % random.randint(0, 2**24 - 1))
t1.shape("turtle")
t1 = turtle.Turtle()
t1.color('#%06x' % random.randint(0, 2**24 - 1))
t1.shape("turtle") t1.pu()
t1.goto(-160,100)
t1.pd()
t1.color('#%06x' % random.randint(0, 2**24 - 1))
t1.shape("turtle")
t1.pu()
t1.goto(-160,100)
t1.pd()
for x in range(100):
t1.fd(random.randint(1,5))
t1,t2,t3,t4 = turtle.Turtle(),turtle.Turtle(),turtle.Turtle(),turtle.Turtle()
t1.color('#%06x' % random.randint(0, 2**24 - 1))
t2.color('#%06x' % random.randint(0, 2**24 - 1))
t3.color('#%06x' % random.randint(0, 2**24 - 1))
t4.color('#%06x' % random.randint(0, 2**24 - 1))
t1.shape("turtle")
t2.shape("turtle")
t3.shape("turtle")
t4.shape("turtle")
t1.pu()
t1.goto(-160,100)
t1.pd()
t2.pu()
t2.goto(-160,70)
t2.pd()
t3.pu()
t3.goto(-160,40)
t3.pd()
t4.pu()
t4.goto(-160,10)
t4.pd()
for x in range(100):
t1.fd(random.randint(1,5))
t2.fd(random.randint(1,5))
t3.fd(random.randint(1,5))
t4.fd(random.randint(1,5))