More actions
imported>syjsmk No edit summary |
imported>syjsmk No edit summary |
||
| Line 18: | Line 18: | ||
if on_beeper(): | if on_beeper(): | ||
turn_off() | turn_off() | ||
turn_off() | |||
==harvest== | |||
def rightHarv(): | |||
repeat(moveAndPick, 6) | |||
def leftHarv(): | |||
turn_left() | |||
move() | |||
pick_beeper() | |||
turn_left() | |||
repeat(moveAndPick, 6) | |||
turn_right() | |||
move() | |||
turn_right() | |||
i = 0 | |||
for i in range(0, 3): | |||
rightHarv() | |||
leftHarv() | |||
turn_off() | turn_off() | ||
Revision as of 09:18, 29 June 2011
미로찾기
def checkLeft():
if left_is_clear():
turn_left()
move()
elif front_is_clear():
move()
elif right_is_clear():
turn_right()
move()
else :
turn_left()
turn_left()
move()
while on_beeper:
checkLeft()
if on_beeper():
turn_off()
turn_off()
harvest
def rightHarv():
repeat(moveAndPick, 6)
def leftHarv():
turn_left()
move()
pick_beeper()
turn_left()
repeat(moveAndPick, 6)
turn_right()
move()
turn_right()
i = 0
for i in range(0, 3):
rightHarv()
leftHarv()
turn_off()