home *** CD-ROM | disk | FTP | other *** search
- (**************************************************************************)
- (* 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, Teams or Obstructions. *)
- (**************************************************************************)
-
- {Bob Sifniades}
-
- {Strategy: Keep moving clock-wise around the periphery of the square in order
- to avoid being shot. Scan clock-wise to keep a lock on targets. Works well
- against any opponent that can't hit a moving target. Works very well against
- non-moving opponents. Works less well on opponents that move and hit
- moving targets. This goes for quantity of shots, not quality.}
-
- PROCEDURE D;
-
- VAR range, angle, goodangle : Integer;
-
-
- PROCEDURE shoot;
- BEGIN
- range := SCAN(angle, 10);
- IF range = 0 THEN
- REPEAT
- angle := angle-20;
- range := SCAN(angle, 10);
- UNTIL range <> 0;
- {range >= 62 guarantees won't shoot self if firing ahead and going}
- {at full speed}
- IF (range >= 62) THEN
- {50/50 chance of firing <angle-5> which hits still targets very well,}
- {and <angle-5> thru <angle-20>, which tries to hit moving targets}
- CANNON(angle-5-Random(1)*Random(15), range);
- END;
-
-
-
- {kludgey driver that gets me where I want to go}
- PROCEDURE Move(x1, y1, x2, y2 : Integer); {x1,y1 is 1st dest; x2,y2 is next dest}
- VAR heading, I : Integer;
- BEGIN
- heading := Angle_To(x1, y1);
- WHILE (distance(loc_x, loc_y, x1, y1)) >= 200 DO
- BEGIN
- DRIVE(heading, 100);
- shoot;
- END;
- DRIVE(heading, 40);
- WHILE speed > 40 DO
- shoot;
- heading := Angle_To(x2, y2);
- DRIVE(heading, 100);
- END; {move}
-
-
- BEGIN
- angle := 10;
- goodangle := -1;
- REPEAT
- Move(950, 100, 100, 50);
- Move(100, 50, 50, 900);
- Move(50, 900, 900, 950);
- Move(900, 950, 950, 100);
- UNTIL DEAD OR WINNER;
- END;
-