home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
P_ROBO31.ZIP
/
BUBBA.PR
< prev
next >
Wrap
Text File
|
1989-10-31
|
16KB
|
279 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, Teams or Obstructions. *)
(**************************************************************************)
PROCEDURE BUBBA;
{ A robot.
No, it is not the big brute the name implies. Rather, this robot operates
under the belief the it is possible to use brains (or trig.) over braun (or
shear speed).
The underlying design is that of a fast but somewhat inaccurate scanner
followed by an attempt at a single intelligent shot. The net result is
a robot that will sometimes shoot way off target, but other times hammer
the opponent. It is designed for only one opponent and would probably
fail miserably in the presence of a crowd.
Its defense is based on the theory that moving robots are the hardest to
hit. Therefore, it employs the longest runs possible by mainly sticking
to diagonals but occasionally switching from one diagonal to the other.
By the way, this robot, unlike most, hits moving targets more accurately
than stationary targets.
All in all, Bubba is a huge compromise, for the environment in which Bubba
exists imposes many restrictions which don't allow a purely intelligent robot
to function.
How to beat Bubba ???
A good question, but I'll tell. Bubba is most effective against robots
that choose (or stumble into) the same path (including the opposite
direction) that Bubba has laid claim to. (The trig. functions are vastly
simplified in these cases ... no guess work is involved). So, traveling
on non-common angles is a good idea. Also, since Bubba is slow, if you can
sneak up on him and then repeatedly blast him at close range, he will
probably sustain more damage than he returns. But, be careful sneaking up
or running away ... Bubba's intelligence will win out if your located.
All in all, Bubba may not be the smartest or fastest. But Bubba is tough.
W. Baird 12/89
}
VAR
s_dir : Integer; { scan direction }
s_dist : Integer; { scanned distance }
old_s_dist : Integer; { previous scanned distance }
PROCEDURE robot(r_dir, turn_time : Integer);
BEGIN
REPEAT
DRIVE(r_dir, 100);
s_dist := SCAN(s_dir, 10);
IF s_dist > 25 THEN
IF s_dist > old_s_dist THEN { constant scan angle }
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : CANNON(s_dir, s_dist+s_dist DIV 6); { --> --> }
{12..35} 1, 2 : CANNON(s_dir, s_dist+s_dist DIV 7);
{36..59} 3, 4 : CANNON(s_dir+3, s_dist+10+s_dist DIV 7);
{60..83} 5, 6 : CANNON(s_dir+5, s_dist+20+s_dist DIV 6);
{84..95} 7 : CANNON(s_dir+6, s_dist+26+s_dist DIV 6);
{96..119} 8, 9 : CANNON(s_dir+4, s_dist+40+s_dist DIV 6);
{120..143} 10, 11 : CANNON(s_dir+3, s_dist+58+s_dist DIV 6);
{144..167} 12, 13 : CANNON(s_dir+2, s_dist+61+s_dist DIV 6);
{168..191} 14, 15 : CANNON(s_dir, s_dist+72+s_dist DIV 5); { <-- --> }
{192..215} 16, 17 : CANNON(s_dir-2, s_dist+62+s_dist DIV 6);
{216..239} 18, 19 : CANNON(s_dir-3, s_dist+50+s_dist DIV 6);
{240..263} 20, 21 : CANNON(s_dir-5, s_dist+40+s_dist DIV 6);
{264..275} 22 : CANNON(s_dir-10, s_dist+30+s_dist DIV 6);
{276..299} 23, 24 : CANNON(s_dir-9, s_dist+28+s_dist DIV 6);
{300..323} 25, 26 : CANNON(s_dir-9, s_dist+12+s_dist DIV 7);
{324..347} 27, 28 : CANNON(s_dir-8, s_dist+s_dist DIV 7);
END {case .. s_dir > old_sdir}
ELSE
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : IF s_dist > 123 THEN CANNON(s_dir, s_dist-75-s_dist DIV 10); { --> <-- }
{12..35} 1, 2 : IF s_dist > 95 THEN CANNON(s_dir, s_dist-60-s_dist DIV 11);
{36..59} 3, 4 : IF s_dist > 70 THEN CANNON(s_dir+3, s_dist-44-s_dist DIV 11);
{60..83} 5, 6 : IF s_dist > 60 THEN CANNON(s_dir+5, s_dist-38-s_dist DIV 11);
{84..95} 7 : IF s_dist > 50 THEN CANNON(s_dir+6, s_dist-28-s_dist DIV 11);
{96..119} 8, 9 : IF s_dist > 40 THEN CANNON(s_dir+5, s_dist-20-s_dist DIV 11);
{120..143} 10, 11 : CANNON(s_dir+3, s_dist-8-s_dist DIV 10);
{144..167} 12, 13 : CANNON(s_dir+2, s_dist-s_dist DIV 9);
{168..191} 14, 15 : CANNON(s_dir, s_dist-s_dist DIV 8); { <-- <-- }
{192..215} 16, 17 : CANNON(s_dir-2, s_dist+5-s_dist DIV 8);
{216..239} 18, 19 : IF s_dist > 40 THEN CANNON(s_dir-3, s_dist-8-s_dist DIV 10);
{240..263} 20, 21 : IF s_dist > 45 THEN CANNON(s_dir-5, s_dist-16-s_dist DIV 10);
{264..275} 22 : IF s_dist > 50 THEN CANNON(s_dir-5, s_dist-28-s_dist DIV 10);
{276..299} 23, 24 : IF s_dist > 60 THEN CANNON(s_dir-4, s_dist-37-s_dist DIV 10);
{300..323} 25, 26 : IF s_dist > 77 THEN CANNON(s_dir-1, s_dist-48-s_dist DIV 10);
{324..347} 27, 28 : IF s_dist > 100 THEN CANNON(s_dir-2, s_dist-58-s_dist DIV 11);
END {case .. s_dir <= old_sdir}
ELSE {dist <= 25}
BEGIN
s_dir := s_dir-20;
IF SCAN(s_dir, 10) = 0 THEN
BEGIN
s_dir := s_dir+40;
IF SCAN(s_dir, 10) = 0 THEN
BEGIN
s_dir := s_dir-60;
WHILE SCAN(s_dir, 10) = 0 DO
s_dir := s_dir-20;
s_dist := SCAN(s_dir, 10);
CANNON(s_dir, s_dist); { forget intelligence here }
CANNON(s_dir, s_dist);
END
ELSE
BEGIN
s_dist := SCAN(s_dir, 10);
IF s_dist > old_s_dist THEN { constant scan angle }
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : CANNON(s_dir+10, s_dist+s_dist DIV 6); { --> --> }
{12..35} 1, 2 : CANNON(s_dir+10, s_dist+s_dist DIV 7);
{36..59} 3, 4 : CANNON(s_dir+13, s_dist+10+s_dist DIV 7);
{60..83} 5, 6 : CANNON(s_dir+15, s_dist+20+s_dist DIV 6);
{84..95} 7 : CANNON(s_dir+16, s_dist+26+s_dist DIV 6);
{96..119} 8, 9 : CANNON(s_dir+14, s_dist+40+s_dist DIV 6);
{120..143} 10, 11 : CANNON(s_dir+13, s_dist+58+s_dist DIV 6);
{144..167} 12, 13 : CANNON(s_dir+12, s_dist+61+s_dist DIV 6);
{168..191} 14, 15 : CANNON(s_dir+10, s_dist+72+s_dist DIV 5); { <-- --> }
{192..215} 16, 17 : CANNON(s_dir+08, s_dist+62+s_dist DIV 6);
{216..239} 18, 19 : CANNON(s_dir+07, s_dist+50+s_dist DIV 6);
{240..263} 20, 21 : CANNON(s_dir+05, s_dist+40+s_dist DIV 6);
{264..275} 22 : CANNON(s_dir, s_dist+30+s_dist DIV 6);
{276..299} 23, 24 : CANNON(s_dir+01, s_dist+28+s_dist DIV 6);
{300..323} 25, 26 : CANNON(s_dir+01, s_dist+12+s_dist DIV 7);
{324..347} 27, 28 : CANNON(s_dir+02, s_dist+s_dist DIV 7);
END {case .. s_dir > old_sdir}
ELSE
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : IF s_dist > 123 THEN CANNON(s_dir+10, s_dist-75-s_dist DIV 10); { --> <-- }
{12..35} 1, 2 : IF s_dist > 95 THEN CANNON(s_dir+10, s_dist-60-s_dist DIV 11);
{36..59} 3, 4 : IF s_dist > 70 THEN CANNON(s_dir+13, s_dist-44-s_dist DIV 11);
{60..83} 5, 6 : IF s_dist > 60 THEN CANNON(s_dir+15, s_dist-38-s_dist DIV 11);
{84..95} 7 : IF s_dist > 50 THEN CANNON(s_dir+16, s_dist-28-s_dist DIV 11);
{96..119} 8, 9 : IF s_dist > 40 THEN CANNON(s_dir+15, s_dist-20-s_dist DIV 11);
{120..143} 10, 11 : CANNON(s_dir+13, s_dist-8-s_dist DIV 10);
{144..167} 12, 13 : CANNON(s_dir+12, s_dist-s_dist DIV 9);
{168..191} 14, 15 : CANNON(s_dir+10, s_dist-s_dist DIV 8); { <-- <-- }
{192..215} 16, 17 : CANNON(s_dir+08, s_dist+5-s_dist DIV 8);
{216..239} 18, 19 : IF s_dist > 40 THEN CANNON(s_dir+07, s_dist-8-s_dist DIV 10);
{240..263} 20, 21 : IF s_dist > 45 THEN CANNON(s_dir+05, s_dist-16-s_dist DIV 10);
{264..275} 22 : IF s_dist > 50 THEN CANNON(s_dir+05, s_dist-28-s_dist DIV 10);
{276..299} 23, 24 : IF s_dist > 60 THEN CANNON(s_dir+06, s_dist-37-s_dist DIV 10);
{300..323} 25, 26 : IF s_dist > 77 THEN CANNON(s_dir+09, s_dist-48-s_dist DIV 10);
{324..347} 27, 28 : IF s_dist > 100 THEN CANNON(s_dir+08, s_dist-58-s_dist DIV 11);
END {case .. s_dir <= old_sdir}
END
END
ELSE
BEGIN
s_dist := SCAN(s_dir, 10);
IF s_dist > old_s_dist THEN { constant scan angle }
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : CANNON(s_dir-10, s_dist+s_dist DIV 6); { --> --> }
{12..35} 1, 2 : CANNON(s_dir-10, s_dist+s_dist DIV 7);
{36..59} 3, 4 : CANNON(s_dir-7, s_dist+10+s_dist DIV 7);
{60..83} 5, 6 : CANNON(s_dir-5, s_dist+20+s_dist DIV 6);
{84..95} 7 : CANNON(s_dir-4, s_dist+26+s_dist DIV 6);
{96..119} 8, 9 : CANNON(s_dir-7, s_dist+40+s_dist DIV 6);
{120..143} 10, 11 : CANNON(s_dir-7, s_dist+58+s_dist DIV 6);
{144..167} 12, 13 : CANNON(s_dir-8, s_dist+61+s_dist DIV 6);
{168..191} 14, 15 : CANNON(s_dir-10, s_dist+72+s_dist DIV 5); { <-- --> }
{192..215} 16, 17 : CANNON(s_dir-12, s_dist+62+s_dist DIV 6);
{216..239} 18, 19 : CANNON(s_dir-13, s_dist+50+s_dist DIV 6);
{240..263} 20, 21 : CANNON(s_dir-15, s_dist+40+s_dist DIV 6);
{264..275} 22 : CANNON(s_dir-20, s_dist+30+s_dist DIV 6);
{276..299} 23, 24 : CANNON(s_dir-19, s_dist+28+s_dist DIV 6);
{300..323} 25, 26 : CANNON(s_dir-19, s_dist+12+s_dist DIV 7);
{324..347} 27, 28 : CANNON(s_dir-18, s_dist+s_dist DIV 7);
END {case .. s_dir > old_sdir}
ELSE
CASE (s_dir-r_dir) MOD 360 DIV 12 OF
{348..11} 0, 29 : IF s_dist > 123 THEN CANNON(s_dir-10, s_dist-75-s_dist DIV 10); { --> <-- }
{12..35} 1, 2 : IF s_dist > 95 THEN CANNON(s_dir-10, s_dist-60-s_dist DIV 11);
{36..59} 3, 4 : IF s_dist > 70 THEN CANNON(s_dir-7, s_dist-44-s_dist DIV 11);
{60..83} 5, 6 : IF s_dist > 60 THEN CANNON(s_dir-5, s_dist-38-s_dist DIV 11);
{84..95} 7 : IF s_dist > 50 THEN CANNON(s_dir-4, s_dist-28-s_dist DIV 11);
{96..119} 8, 9 : IF s_dist > 40 THEN CANNON(s_dir-5, s_dist-20-s_dist DIV 11);
{120..143} 10, 11 : CANNON(s_dir-7, s_dist-8-s_dist DIV 10);
{144..167} 12, 13 : CANNON(s_dir-8, s_dist-s_dist DIV 9);
{168..191} 14, 15 : CANNON(s_dir-10, s_dist-s_dist DIV 8); { <-- <-- }
{192..215} 16, 17 : CANNON(s_dir-8, s_dist+5-s_dist DIV 8);
{216..239} 18, 19 : IF s_dist > 40 THEN CANNON(s_dir-7, s_dist-8-s_dist DIV 10);
{240..263} 20, 21 : IF s_dist > 45 THEN CANNON(s_dir-5, s_dist-16-s_dist DIV 10);
{264..275} 22 : IF s_dist > 50 THEN CANNON(s_dir-5, s_dist-28-s_dist DIV 10);
{276..299} 23, 24 : IF s_dist > 60 THEN CANNON(s_dir-6, s_dist-37-s_dist DIV 10);
{300..323} 25, 26 : IF s_dist > 77 THEN CANNON(s_dir-9, s_dist-48-s_dist DIV 10);
{324..347} 27, 28 : IF s_dist > 100 THEN CANNON(s_dir-8, s_dist-58-s_dist DIV 11);
END {case .. s_dir <= old_sdir}
END;
END;
old_s_dist := s_dist;
UNTIL time >= turn_time;
DRIVE(r_dir, 40);
WHILE speed > 50 DO
BEGIN
s_dist := SCAN(s_dir, 10);
IF s_dist > 39 THEN
BEGIN { no time to be intelligent }
CANNON(s_dir, s_dist);
CANNON(s_dir, s_dist);
END
ELSE
BEGIN
s_dir := s_dir-20;
IF SCAN(s_dir, 10) = 0 THEN
BEGIN
s_dir := s_dir+40;
IF SCAN(s_dir, 10) = 0 THEN
BEGIN
s_dir := s_dir-60;
WHILE SCAN(s_dir, 10) = 0 DO
s_dir := s_dir-20;
END;
END;
s_dist := SCAN(s_dir, 10);
CANNON(s_dir, s_dist);
CANNON(s_dir, s_dist);
END;
old_s_dist := s_dist;
END;
END; {robot}
BEGIN
IF loc_y < 500 THEN
BEGIN
s_dir := 14515; {115}
robot(Angle_To(100, 900), { n-w }
time+distance(loc_x, loc_y, 225, 775) DIV 4);
robot(Angle_To(900, 100), { s-e }
time+distance(loc_x, loc_y, 775, 225) DIV 4);
END
ELSE
BEGIN
s_dir := 14735; {335}
robot(Angle_To(900, 100), { s-e }
time+distance(loc_x, loc_y, 775, 225) DIV 4);
END;
REPEAT
robot(Angle_To(100, 900), { n-w }
time+distance(loc_x, loc_y, 200, 800) DIV 4);
robot(Angle_To(900, 100), { s-e }
time+distance(loc_x, loc_y, 820, 180) DIV 4);
robot(135, { n-w }
time+distance(loc_x, loc_y, 180, 820) DIV 4);
robot(315, { s-e }
time+distance(loc_x, loc_y, 820, 180) DIV 4);
robot(Angle_To(500, 900), { n-nw }
time+distance(loc_x, loc_y, 530, 800) DIV 4);
robot(Angle_To(100, 100), { s-sw }
time+distance(loc_x, loc_y, 180, 180) DIV 4);
s_dir := s_dir+10;
robot(Angle_To(900, 900), { n-e }
time+distance(loc_x, loc_y, 800, 800) DIV 4);
robot(Angle_To(100, 100), { s-w }
time+distance(loc_x, loc_y, 180, 180) DIV 4);
robot(45, { n-e }
time+distance(loc_x, loc_y, 800, 800) DIV 4);
robot(225, { s-w }
time+distance(loc_x, loc_y, 180, 180) DIV 4);
robot(Angle_To(500, 900), { n-ne }
time+distance(loc_x, loc_y, 470, 820) DIV 4);
robot(Angle_To(900, 100), { s-se }
time+distance(loc_x, loc_y, 820, 180) DIV 4);
s_dir := s_dir+10;
UNTIL DEAD;
END;