赞
踩
本文整理汇总了Python中turtle.left方法的典型用法代码示例。如果您正苦于以下问题:Python turtle.left方法的具体用法?Python turtle.left怎么用?Python turtle.left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块turtle的用法示例。
在下文中一共展示了turtle.left方法的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: draw_tree
点赞 7
# 需要导入模块: import turtle [as 别名]
# 或者: from turtle import left [as 别名]
def draw_tree(length, width=9):
color = "brown"
if length < 1:
return
elif length < 3:
color = "green"
if width < 1:
width = 1
turtle.color(color)
turtle.width(width)
turtle.forward(length)
turtle.left(30)
draw_tree(length / FACTOR, width - 1)
turtle.right(60)
draw_tree(length / FACTOR, width - 1)
turtle.left(30)
turtle.color(color)
turtle.width(width)
turtle.backward(length)
开发者ID:johnehunt,项目名称:advancedpython3,代码行数:23,
示例2: square
点赞 6
# 需要导入模块: import turtle [as 别名]
# 或者: from turtle import left [as 别名]
def square(x, y, size, name):
"""Draw square at `(x, y)` with side length `size` and fill color `name`.
The square is oriented so the bottom left corner is at (x, y).
"""
import turtle
turtle.up()
turtle.goto(x, y)
turtle.down()
turtle.color(name)
turtle.begin_fill()
for count in range(4):
turtle.forward(size)
turtle.left(90)
turtle.end_fill()
开发者ID:PacktPublishing,项目名称:Learning-Python-by-building-games,代码行数:20,
示例3: gear
点赞 6
# 需要导入模块: import turtle [as 别名]
# 或者: from turtle import left [as 别名]
def gear(cou
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。