home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
P_ROBO31.ZIP
/
BTEAM1.PR
< prev
next >
Wrap
Text File
|
1993-02-21
|
3KB
|
101 lines
(**************************************************************************)
(* W A R N I N G *)
(* *)
(* This Robot has NOT been designed to take advantage of the advanced *)
(* features of P-ROBOTS, such as, Shields, Fuel or Obstructions. *)
(**************************************************************************)
PROCEDURE BTEAM1;
TeamAlly = "bteam2";
{ A Tag-team robot.
This robot walks the walls in a clockwise fashion, expecting its counterpart
to be walking the opposite wall at all times. Should a team mate get taken
out, one can still cover the board in a fairly effective fashion.
W. Baird ... 12/89
}
CONST
side_time = 220;
VAR
s_dir : Integer;
s_dist : Integer;
spd : Integer;
turn_time : Integer;
turn_time1 : Integer;
PROCEDURE GOTO(x, y : Integer);
VAR heading : Integer;
BEGIN
heading := Angle_To(x, y);
WHILE (distance(loc_x, loc_y, x, y) > 150) DO DRIVE(heading, 100);
WHILE (distance(loc_x, loc_y, x, y) > 10) DO DRIVE(heading, 20);
spd := 0;
DRIVE(0, 0);
END;
PROCEDURE robot(r_dir : Integer);
BEGIN
REPEAT
DRIVE(r_dir, spd);
s_dir := s_dir+20;
WHILE SCAN(s_dir, 10) = 0 DO
s_dir := s_dir-20;
s_dist := SCAN(s_dir, 10);
IF s_dist > 625 THEN
IF time < turn_time1 THEN
BEGIN
REPEAT
s_dir := s_dir-20
UNTIL SCAN(s_dir, 10) > 0;
s_dist := SCAN(s_dir, 10);
IF s_dist > 39 THEN
BEGIN
CANNON(s_dir, s_dist);
CANNON(s_dir, s_dist+50);
END;
END
ELSE
ELSE
IF s_dist > 39 THEN
BEGIN
CANNON(s_dir, s_dist);
CANNON(s_dir, s_dist+50);
END;
UNTIL time >= turn_time;
DRIVE(r_dir, 40);
WHILE speed > 50 DO
BEGIN
s_dir := s_dir+20;
WHILE SCAN(s_dir, 10) = 0 DO
s_dir := s_dir-20;
s_dist := SCAN(s_dir, 10);
IF s_dist > 39 THEN
BEGIN
CANNON(s_dir, s_dist);
CANNON(s_dir, s_dist);
END;
END;
turn_time := time DIV side_time*side_time+side_time;
turn_time1 := turn_time-20;
END; {robot}
BEGIN
s_dir := 14400;
GOTO(100, 100);
turn_time := 300;
turn_time1 := 280;
robot(90);
spd := 100;
REPEAT
robot(Angle_To(100, 900));
robot(Angle_To(900, 900));
robot(Angle_To(900, 100));
robot(Angle_To(100, 100));
UNTIL DEAD;
END;