[Home]History of Squirrel/Nano

Robo Home | Changes | Preferences | AllPages


Revision 7 . . October 31, 2006 14:22 EST by Bayen [comment]
Revision 6 . . October 29, 2006 21:08 EST by Voidious [doh]
  

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

Removed: 12d11
//import java.awt.Color;

Changed: 15,16c14,16
* Squirrel - a robot by (your name here)
* codesize: 237
* Squirrel - a robot by Bayen
*
* Codesize Reduction Help: Voidious (Thanks!)

Changed: 20c20
//private static final double INFINITY = Double.POSITIVE_INFINITY;
//CONSTANTS:

Removed: 29d28
//private static final double THREE = 3.0;

Changed: 33c32,33


//VARIALBES:

Removed: 39,41d38
/**
* run: Squirrel's default behavior
*/

Removed: 43,45d39
// After trying out your robot, try uncommenting the import at the top,
// and the next line:
//setColors(Color.red,Color.blue,Color.green);

Removed: 51,53d44
/**
* onScannedRobot: What to do when you see another robot
*/

Changed: 61,62c52,55
if(_energy > (_energy = e.getEnergy()))
_direction *= _moveCheck;
double difference;
if((difference = _energy - (_energy = e.getEnergy())) <= BULLET_POWER && difference > ONE_TENTH) {
_direction *= _moveCheck;
}

Changed: 65,66c58,59
double absoluteBearing = getHeadingRadians() + bearing;
setTurnGunRightRadians?(Utils.normalRelativeAngle(absoluteBearing - getGunHeadingRadians?() + ((_gunCheck<ZERO?((Math.random() * SIXTEEN) - EIGHT):e.getVelocity()) * Math.sin(e.getHeadingRadians() - absoluteBearing) / THIRTEEN)));
bearing += getHeadingRadians();
setTurnGunRightRadians?(Utils.normalRelativeAngle(bearing - getGunHeadingRadians?() + ((_gunCheck<ZERO?((Math.random() * SIXTEEN) - EIGHT):e.getVelocity()) * Math.sin(e.getHeadingRadians() - bearing) / THIRTEEN)));

Changed: 68c61
setFire(BULLET_POWER);
setFire(POSITIVE_ONE);

Removed: 71,73d63
/**
* onHitByBullet?: What to do when you're hit by a bullet
*/

Removed: 78,80d67
/**
* onBulletHit?: What to do when a bullet hits
*/

Removed: 85,87d71
/**
* onBulletMissed?: What to do when a bullet misses
*/

Removed: 92,94d75
/**
* onHitWall?: What to do when you hit a wall
*/

Changed: 98,99c79,80
}
</pre>

}</pre>

Changed: 208c189,191
Whoah, sorry, I missed your previous update. Anyway, the second change I made could still apply, I think. Good luck. -- Voidious
Whoah, sorry, I missed your previous update. Anyway, the second change I made could still apply, I think. Good luck. -- Voidious

No, I prefer your changes because I don't have to sacrifice the accuracy of the Energy Drop prediction. So thanks! I replaced the code up top with the finalized version. --Bayen

Robo Home | Changes | Preferences | AllPages
Search: