package kawigi.haiku; import robocode.*; /** * HaikuEight - does figure-8's laterally to its opponent, if it doesn't hit the walls (which it does often). */ public class HaikuEight extends AdvancedRobot { public void run() { turnRight(720); } public void onScannedRobot(ScannedRobotEvent e) { setAhead(Double.POSITIVE_INFINITY); setTurnRight((getTime()%180 < 90) ? 720 : -720); setFire(e.getEnergy()/4); } }