home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
127.lha
/
C_Robots
/
flyby.r
< prev
next >
Wrap
Text File
|
1986-11-20
|
643b
|
62 lines
main()
int x,range,flag;
{
while(1)
{
flag=0;
if (scan(x,10) == 0)
x=x+180;
while(flag==0)
{
range=scan(x,10);
if (range != 0)
{
if (range > 400)
{ cannon(x,range);
drive(x,50);
x=x-20; }
else
{
x=killit(x,range);
flag=1; } }
else x=x-20;
}
}
}
killit(x,range)
int x,range;
{
while ((range != 0) && (range < 500))
{
x=improve(x);
range=scan(x,10);
if (range>40)
cannon(x,range);
if (range>100)
drive(x-10,50);
}
return x; }
improve(x)
int x;
{
if (scan(x-5,5) != 0)
x=x-5;
else
x=x+5;
if (scan(x-3,3) != 0)
x=x-3;
else
x=x+3;
return x;
}