[Home]History of Poets

Robo Home | Changes | Preferences | AllPages


Revision 17 . . June 14, 2005 15:52 EST by PEZ
Revision 16 . . (edit) October 14, 2004 11:29 EST by PEZ
  

Difference (from prior major revision) (no other diffs)

Changed: 116,139c116
Download: http://www.robocoderepository.com/BotDetail.jsp?id=1748

Source:

package pez.femto;
import robocode.*;

// By Peter Strömberg, http://robowiki.dyndns.org/?PEZ
// Blind and strong

public class DroidPoet extends Robot implements Droid {
public void run() {
while (true) {
ahead(Math.random() * 600);
turnGunRight(Math.toDegrees(Math.atan2(getBattleFieldWidth() / 2 - getX(),
getBattleFieldHeight() / 2 - getY())) - getGunHeading());
fire(1.2);
}
}

public void onHitWall(HitWallEvent e) {
turnRight(90 - getHeading() % 90);
}
}

Here: DroidPoet

Robo Home | Changes | Preferences | AllPages
Search: