本文整理汇总了Python中tealight.robot.turn函数的典型用法代码示例。如果您正苦于以下问题:Python turn函数的具体用法?Python turn怎么用?Python turn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了turn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: go
def go():
while touch() == "fruit":
move()
if touch() != "fruit":
turn(3)
go()
示例2: go
def go():
move()
if (touch()!='fruit'):
turn(-1)
go()
return
go()
示例3: go
def go():
moved = 0
while touch() == "fruit":
move()
moved = moved + 1
turn(-1)
示例4: super_move
def super_move():
if touch() != "wall":
move()
elif left_side() == "wall":
turn(1)
else:
turn(3)
示例5: columnsd
def columnsd():
turn(-1)
for n in range(0,4):
move()
turn(-1)
for k in range(0,30):
move()
示例6: rowsr
def rowsr():
turn(1)
for n in range(0,4):
move()
turn(1)
for j in range(0,32):
move()
示例7: rowsl
def rowsl():
turn(-1)
for n in range(0,4):
move()
turn(-1)
for j in range(0,32):
move()
示例8: go
def go():
while True:
if left_side() == False:
turn(1)
if right_side() == False:
turn(-1)
move()
示例9: main
def main():
while True:
while True:
move()
if right_side()=='wall' and touch()=='wall':
turn(-1)
elif left_side()=='wall' and touch()=='wall':
turn(1)
示例10: find_fruit
def find_fruit():
for i in range(1,4):
if (look() == "fruit"):
move()
return True
else:
turn(1)
return False
示例11: scan
def scan():
i = 0
while look()=='wall' and i<4:
turn(1)
i=i+1
if look()=='wall':
return 0
else:
return 1
示例12: branch
def branch(dir):
turn(dir)
if touch() == 'fruit':
while touch() == 'fruit':
move()
elif left_side() == 'fruit':
branch(-1)
elif right_side() == 'fruit':
branch(1)
示例13: find
def find():
i=0
while touch()!='fruit' and left_side()!='fruit' and right_side()!='fruit':
if look()=='fruit':
i=i+1
print i
move()
else:
turn(-1)
move()
示例14: trythisway
def trythisway():
move()
if left_side()=='fruit':
return -1
elif right_side()=='fruit':
return 1
elif str(look())=='fruit':
move()
return(2)
else:
turn(2)
move()
return(0)
示例15: go
def go():
moved = 0
if touch() == 'fruit':
move()
moved = moved + 1
elif touch() == None:
turn(1)
else:
turn(1)
go()
for i in range(0,moved):
go()