home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / a / control / solutions / buggy_1 < prev    next >
Text File  |  1991-01-02  |  334b  |  25 lines

  1. / This solves the buggy problem
  2. / When it is further away it makes a larger movement
  3.  
  4.  
  5. beacon 
  6. repeat
  7.   forward 200
  8.   if lefteye > righteye
  9.   then
  10.     left
  11.   else                
  12.     right
  13.   endif
  14. until distance < 200
  15.  
  16. repeat
  17.   forward 30
  18.   if lefteye > righteye
  19.   then
  20.     left
  21.   else                
  22.     right
  23.   endif
  24. until arrived
  25.