home *** CD-ROM | disk | FTP | other *** search
- PROCEDURE SubMini;
-
- { Based on C-Robot HAK3 (Hunter-Killer III a.k.a. Submini)
-
- by John Hardin
-
- Strategy: Subminimal robot program. Scan the arena in 85 degree
- increments (precession will ensure we scan the entire
- arena). If we see a robot, charge at it firing continuously.
- Don't worry about taking hits.
-
- This robot is suicidal and fratricidal, but effective. }
-
- VAR
- dir : Integer;
- Range : Integer;
-
- BEGIN { SubMini main }
-
- dir := 0;
-
- REPEAT { Until Dead or Winner }
-
- drive(dir, 50); { max speed that can still turn }
- WHILE (scan(dir, 10) > 0) DO cannon(dir, scan(dir, 10)); { shoot at foe. }
- dir := dir+85; { keep scanning }
-
- UNTIL Dead OR Winner;
-
- END; { end of SubMini main }
-