예제 #1
0
파일: Step 05.py 프로젝트: LoukHin/Reeborg
def go_take(direction):
    if direction == "l":
        turn = turn_left
    else:
        turn = turn_right
    move()
    turn()
    for _ in range(2):
        move()
        take()
    turn_back()
    multi_move(2)
    while carries_object():
        put()
    turn()
예제 #2
0
def go(direction):
    if direction == "l":
        first_turn = turn_right
        turn = turn_left
    else:
        first_turn = turn_left
        turn = turn_right
    first_turn()
    multi_move(2)
    turn()
    multi_move(3)
    turn()
    multi_move(2)
    turn()
예제 #3
0
파일: Step 16.py 프로젝트: LoukHin/Reeborg
from library import multi_move, turn_right, turn_back


def turn():
    if is_facing_north():
        turnx = turn_right
    else:
        turnx = turn_left
    turnx()
    move()
    turnx()


multi_move(2)
turn_left()
move()
for _ in range(6):
    move()
    for _ in range(6):
        if object_here():
            take()
        move()
    turn()
turn_back()
move()
while carries_object():
    put()


################################################################
# WARNING: Do not change this comment.
예제 #4
0
from library import multi_move, turn_right, turn_back

multi_move(3)
turn_left()
multi_move(2)
take()
turn_right()
multi_move(4)
put()
turn_right()
multi_move(2)
take()
turn_right()
multi_move(2)
turn_left()
multi_move(3)
put()
move()


################################################################
# WARNING: Do not change this comment.
# Library Code is below.
################################################################
def multi_move(count=1):
    for _ in range(count):
        move()


def turn_right():
    turn_left()
예제 #5
0
from library import multi_move, turn_right, turn_back
while front_is_clear():
    if object_here():
        take()
    move()
turn_back()
multi_move(12)
while carries_object():
    put()
move()


################################################################
# WARNING: Do not change this comment.
# Library Code is below.
################################################################
def multi_move(count=1):
    for _ in range(count):
        move()


def turn_right():
    turn_left()
    turn_left()
    turn_left()


def turn_back():
    turn_left()
    turn_left()
예제 #6
0
파일: Step 20.py 프로젝트: LoukHin/Reeborg
from library import multi_move, turn_right, turn_back
multi_move(3)
turn_right()
move()
while not at_goal():
    if right_is_clear():
        move()
        if wall_on_right():
            turn_back()
            move()
            turn_left()
            build_wall()
            turn_left()
        else:
            turn_back()
            move()
            turn_left()
            move()
    elif front_is_clear():
        move()
    else:
        turn_left()


################################################################
# WARNING: Do not change this comment.
# Library Code is below.
################################################################
def multi_move(count=1):
    for _ in range(count):
        move()
예제 #7
0
파일: Step 01.py 프로젝트: LoukHin/Reeborg
from library import multi_move, turn_right, turn_back

multi_move(4)


################################################################
# WARNING: Do not change this comment.
# Library Code is below.
################################################################
def multi_move(count=1):
    for _ in range(count):
        move()


def turn_right():
    turn_left()
    turn_left()
    turn_left()


def turn_back():
    turn_left()
    turn_left()
예제 #8
0
파일: Step 12.py 프로젝트: LoukHin/Reeborg
def go(turn):
    multi_move(4)
    turn()
    multi_move(4)