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()
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()
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.
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()
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()
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()
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()
def go(turn): multi_move(4) turn() multi_move(4)