home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 138.lha / Cycle / MrRight.c < prev    next >
C/C++ Source or Header  |  1986-11-20  |  525b  |  25 lines

  1. /*
  2.  * An example of a simple player. As his name suggests, Mr. Right just tries
  3.  * to turn right if his way is blocked, and turns left if there's something
  4.  * in the way. As you can see, writing a simple player using the manager code
  5.  * is trivial.
  6.  */
  7. #include "cycles.h"
  8.  
  9. char player_name[] = "Mr. Right";
  10.  
  11. strategy_init() {}
  12. strategy_finish() {}
  13.  
  14. strategy()
  15. {
  16.   long x,y,dir;
  17.  
  18.   GetInfo(&x,&y,&dir);
  19.   if (!Look(dir))
  20.     return(dir);
  21.   if (!Look(TURN_RIGHT(dir)))
  22.     return(TURN_RIGHT(dir));
  23.   return(TURN_LEFT(dir));
  24. }
  25.