beginning_of_program define_new_instruction turnright as iterate 3 times turnleft; define_new_instruction u_izq as { turnleft; move; turnright; } define_new_instruction u_der as { turnright; move; turnleft; } define_new_instruction probar_puerta as { if front_is_clear then { if left_is_clear then u_izq; if front_is_blocked then { u_der; move; } else if right_is_clear then { if front_is_blocked then { u_izq; move; } } beginning_of_execution; if front_is_clear then probar_puerta; turnoff; end_of_execution end_of_program