class program { define turnright() { iterate(3) { turnleft(); } } define rightHandOnWall() { while (rightIsClear) { turnleft(); } } define visit() { while (anyBeepersInBeeperBag) { if (rightIsClear) { turnright(); } if (frontIsClear) { move(); } else { turnleft(); } if (frontIsBlocked && leftIsBlocked && rightIsBlocked) { if (nextToABeeper) { turnoff(); } else { putbeeper(); } } } } program() { rightHandOnWall(); visit(); } }