本文整理汇总了Python中tealight.logo.turn函数的典型用法代码示例。如果您正苦于以下问题:Python turn函数的具体用法?Python turn怎么用?Python turn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了turn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: waterwheel
def waterwheel(edges, size):
angle = 210.0
decoration = size / 2
for i in range(0, edges):
move(size)
square(decoration)
turn(angle)
示例2: waterwheel
def waterwheel(edges, size):
angle = 360 / edges
decoration = size /3
for i in range(0, edges):
move(size)
triangle(decoration)
turn(angle)
示例3: waterwheel
def waterwheel(edges, size):
angle = 360 / edges
decoration = size / 2
for i in range(0, edges):
move(size)
shape(decoration, 3)
turn(angle)
示例4: waterwheel
def waterwheel(edges, size):
angle = 400 / edges
decoration = size / 6
for i in range(0, edges):
move(size)
square(decoration)
turn(angle)
示例5: waterwheel
def waterwheel(edges, size): #Drawing waterwheel
angle = 360 / edges
decoration = size / 2
for i in range(0, edges):
move(size)
square(decoration)
turn(angle)
示例6: board
def board(side):
for i in range(0,8):
row(side)
move(side)
turn(-90)
move(side*8)
turn(90)
示例7: spiral
def spiral(size):
if size > 300:
return
move(size)
turn(60)
spiral(size + 5)
示例8: spiral
def spiral(size):
if size > 300: #terminate after 300 rounds
return
move(size)
turn(60) #interior angle
spiral(size + 5) #make new side slightly bigger
示例9: spiral
def spiral(size):
if size > 300:
return
move(size)
turn(90)
spiral(size + 10)
示例10: spiral
def spiral(size):
if size > 500:
return
move(size)
turn(91)
spiral(size + 5)
示例11: waterwheel
def waterwheel(edges, size):
angle = 360 / edges
decoration = size / 4
for i in range(0, edges):
move(size)
#square(decoration)
circle(500)
turn(angle)
示例12: blacksquare
def blacksquare(size):
if size > 300:
return
move(size)
turn(90)
blacksquare(size + 0.5)
示例13: spiral
def spiral(size):
if size > 300:
return
color("RGB(255,10,0)")
move(size)
turn(120)
spiral(size + 8)
示例14: segment
def segment(scale, detail):
if detail == 0:
None
else:
for i in range(0, 3):
move(scale)
turn(120)
segment(scale / 2, detail - 1)
示例15: handle_frame
def handle_frame():
global d
for x in range(10):
d += 1
color("hsl(%d,100%%,50%%)" % d)
move(random() * 5)
turn(random() * 90 - 45)