[Home]Senticous

Robo Home | Changes | Preferences | AllPages

A nano guessfactor. The code can be used as long as credit is given.

// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: https://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package kinsen.nano;

import robocode.*;
import robocode.util.Utils;

public final class Senticous extends AdvancedRobot
{

    public final void run()
    {
        b = 150D;
        setTurnRadarRightRadians((1.0D / 0.0D));
    }

    public final void onScannedRobot(ScannedRobotEvent scannedrobotevent)
    {
        setTurnRadarLeftRadians(getRadarTurnRemaining());
        setTurnRightRadians(scannedrobotevent.getBearingRadians() - 1.5707963267948966D);
        if(Math.random() < 0.29999999999999999D)
            b = -b;
        if(getDistanceRemaining() == 0.0D)
            setAhead(b * Math.random());
        double d;
        setTurnGunRightRadians(Utils.normalRelativeAngle(((d = scannedrobotevent.getBearingRadians() + getHeadingRadians()) + (Math.signum(scannedrobotevent.getEnergy() * a_double_static_fld) * Math.asin((double)(a_int_static_fld - 8) / scannedrobotevent.getDistance()) * scannedrobotevent.getDistance()) / 14D) - getGunHeadingRadians()));
        if(scannedrobotevent.getVelocity() != 0.0D)
            a_double_static_fld = Math.sin(d - scannedrobotevent.getHeadingRadians()) * scannedrobotevent.getVelocity();
        if(setFireBullet((double)2 + (double)a_int_static_fld / 100D) != null)
            a_int_static_fld = a_java_lang_StringBuffer_static_fld.charAt((int)(Math.random() * (double)a_java_lang_StringBuffer_static_fld.length()));
    }

    public final void onBulletHit(BulletHitEvent bullethitevent)
    {
        a_java_lang_StringBuffer_static_fld.append((char)(int)Math.round((bullethitevent.getBullet().getPower() - (double)2) * 100D));
    }

    public Senticous()
    {
    }

    private static StringBuffer a_java_lang_StringBuffer_static_fld = new StringBuffer("\000\001\002\003\004\005\006\007\b\t\n\013\f\r\016\017\020");
    private static double a_double_static_fld;
    private static int a_int_static_fld;
    private static double b;

}

Mapping:

kinsen.nano.Senticous -> kinsen.nano.Senticous:
    java.lang.StringBuffer lateralVelocities -> a
    double lastDirection -> a
    int chosenLateral -> a
    double direction -> b
    void run() -> run
    void onScannedRobot(robocode.ScannedRobotEvent) -> onScannedRobot
    void onBulletHit(robocode.BulletHitEvent) -> onBulletHit

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited January 19, 2007 1:34 EST by ppp-71-137-136-133.dsl.sndg02.pacbell.net (diff)
Search: