Public feed #722876

Miscellany

public java v1 · immutable
Raw Edit
·published 2007-10-02 12:11 UTC
rendered paste body
package man;import robocode.*;import java.awt.Color;//import java.util.Random;public class a1163807Robot extends Robot {    public double field_x = 0;    public double field_y = 0;        public void run() {        setGunColor(Color.BLACK);        setRadarColor(Color.BLACK);        field_x = getBattleFieldWidth();        field_y = getBattleFieldHeight();                //Random rndgen = new Random();        while (true) {            double turning = 20;//(double)rndgen.nextInt(360);            //out.println(turning);            ahead(field_x / 10);            turnGunRight(360);            turnLeft(turning);            ahead(field_x / 10);            turnGunRight(360);        }    }        public void onScannedRobot(ScannedRobotEvent e) {        fire(1);    }}