示例#1
0
def home():
    turn_left()
    move()
    turn_right()
    move_x(2)
    turn_right()
    move()
示例#2
0
def jump():
    turn_left()
    move()
    turn_right()
    move()
    turn_right()
    move()
    turn_left()
示例#3
0
def home():
    while object_here():
        take()
    turn_left()
    move()
    turn_right()
    move_x(2)
    turn_right()
    move()
示例#4
0
def corner():
    turn_right()
    takeobject()
    move()
    turn_left()
    takeobject()
    move()
    turn_around()
    takeobject()
示例#5
0
def jump():
    turn_left()
    while wall_on_right():
        move()
    turn_right()
    move()
    turn_right()
    while front_is_clear():
        move()
    turn_left()
示例#6
0
def bypass():
    takeobject()
    turn_right()
    move()
    turn_left()
    move()
    move()
    turn_left()
    move()
    turn_right()
    takeobject()
示例#7
0
def right():
    while object_here():
        take()
    turn_right()
    if wall_in_front():
        turn_around()
        while front_is_clear():
            move()
        dump()
        #break
    else:
        move()
        turn_right()
示例#8
0
def draw_zero():  #robot will draw a number zero
    draw_one()
    turn_right()
    move()
    put()
    move()
    turn_right()
    draw_one()
    turn_right()
    move()
    put()
示例#9
0
    while object_here():
        take()
    if front_is_clear():
        move()
    else:
        if count%2:
            turn = turn_right
        else:
            turn = turn_left
        turn()
        if front_is_clear():
            move()
            turn()
            count += 1
        else:
            turn_right()
            clear_move()
            break
while carries_object():
    put()
turn_back()
clear_move()
turn_left()
clear_move()
################################################################
# WARNING: Do not change this comment.
# Library Code is below.
################################################################
def multi_move(count=1):
    for _ in range(count):
        move()
示例#10
0
def up_3_steps():
    for r in range(0, 3):
        turn_left()
        move()
        turn_right()
        move_x(2)
示例#11
0
def down_3_steps():
    for r in range(0, 3):
        move_x(2)
        turn_left()
        move()
        turn_right()
示例#12
0
def right():
    while object_here():
        take()
    turn_right()
    move()
    turn_right()
示例#13
0
    turn_left()
    move()
    turn_left()
    while not wall_in_front():
        move()
    turn_around()

while True:
    clear_row()
    try:
        go_to_next_row()
    except ReeborgError:
        break
turn_around()
while front_is_clear():
    move()
turn_right()
while front_is_clear():
    move()
turn_right()

move()

while carries_object("leaf"):
    put("leaf")
turn_around()
move()
turn_around()
build_wall()
done()
示例#14
0
def right():
    for r in range(0, 2):
        turn_right()
        move()