Start in search mode. 1. Chase mode if motion seen: Turn towards motion. Reset chase timeout. while timeout--: If motion seen: Turn towards motion. Reset timeout. Move forward. if close enough: Greeting mode. Search mode. 2. Greeting mode Stop. Beep. Wait. Search mode. 3. Search mode Randomly select clockwise or counterclockwise. Clear distance. loop: distance++ Turn. Move forward by distance. if close enough: Stop. Turn 90 degrees in a random direction. Reverse a short distance. Corner finding. if motion seen: Chase mode. 4. Corner finding Straighten out. loop: if motion seen: Chase mode. randomly: Search mode. Move forward. if close enough: Lurking. 5. Lurking Stop. Turn in a random direction. Reverse in a circle 180 degrees. Straighten out. Reverse slightly. Stop. loop: Wait. if motion seen: randomly: Chase mode.