home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
138.lha
/
Cycle
/
MrRight.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-11-20
|
525b
|
25 lines
/*
* An example of a simple player. As his name suggests, Mr. Right just tries
* to turn right if his way is blocked, and turns left if there's something
* in the way. As you can see, writing a simple player using the manager code
* is trivial.
*/
#include "cycles.h"
char player_name[] = "Mr. Right";
strategy_init() {}
strategy_finish() {}
strategy()
{
long x,y,dir;
GetInfo(&x,&y,&dir);
if (!Look(dir))
return(dir);
if (!Look(TURN_RIGHT(dir)))
return(TURN_RIGHT(dir));
return(TURN_LEFT(dir));
}