标签:start tle pytho goto 技术分享 enc cti sys ==

import turtle
import sys
turtle.down()
turtle.pencolor(1,0,0)
def leaf(startx ,starty , direction):
turtle.up();
turtle.goto(startx,starty)
turtle.down()
for i in range(125):
if direction ==1:
turtle.forward(2)
turtle.right(1)
else:
turtle.forward(-2)
turtle.right(-1)
turtle.up();
turtle.goto(startx,starty)
turtle.down();
for i in range(130):
if direction ==1:
turtle.forward(2)
turtle.right(-1)
else:
turtle.forward(-2)
turtle.right(1)
leaf(50,0,1)
leaf(0,50,1)
leaf(-50,0,1)
leaf(0,-50,1)
turtle.right(70)
turtle.forward(100)
turtle.done()
标签:start tle pytho goto 技术分享 enc cti sys ==
原文地址:http://www.cnblogs.com/baihang520/p/7745117.html