Line 1    Col 1   Insert            A:P2711B.HAL

BEGINNING-OF-PROGRAM

DEFINE-NEW-INSTRUCTION turnright AS BEGIN ITERATE 3 TIMES turnleft END; DEFINE-NEW-INSTRUCTION corner-right AS BEGIN turnright; move END; DEFINE-NEW-INSTRUCTION left-or-straight AS BEGIN IF front-is-blocked THEN turnleft ELSE move END; DEFINE-NEW-INSTRUCTION search-for-beeper AS BEGIN IF right-is-clear THEN corner-right ELSE left-or-straight END;

BEGINNING-OF-EXECUTION

WHILE not-next-to-a-beeper DO search-for-beeper; turnoff

END-OF-EXECUTION

END-OF-PROGRAM