home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
maj
/
542
/
coward.pr
< prev
next >
Wrap
Text File
|
1993-04-01
|
1KB
|
41 lines
PROCEDURE Coward;
{
Author: David Malmberg
Strategy: Raise shield. Go to a top left corner and wait. Never fire.
Conserve fuel and try to out last opponents and win by default.
When using fuel, this robot can be suprisingly effective.
If not using fuel, its "sitting-duck" strategy makes it easy
prey.
}
PROCEDURE GOTO(x, y : Integer);
{ Go to location X,Y on playing field. }
VAR Heading : Integer;
BEGIN
{ Find the heading we need to get to the desired spot. }
Heading := Angle_To(x, y);
{ Keep traveling at top speed until we are within 150 meters }
WHILE (distance(loc_x, loc_y, x, y) > 150) DO Drive(Heading, 100);
{ Cut speed, and creep the rest of the way. }
WHILE (distance(loc_x, loc_y, x, y) > 20) DO Drive(Heading, 20);
{ Stop driving, should coast to a stop. }
Drive(Heading, 0); {I.E., Stop}
END; {GoTo(X,Y)}
BEGIN {Coward Main}
RaiseShield;
GoTo(0,999); {Top left corner}
REPEAT
{emtpy -- do nothing}
UNTIL Winner OR Dead;
END; {Coward Main}