This is the code to Komarious 1.59. Code size is 1359 when compiled with Jikes (no colors). |
This is the code to Komarious 1.712. Code size is 1492 when compiled with Jikes (3 colors = 13 bytes). |
import java.awt.Color; |
private static double _nextSurfSegment?[]; |
|
|
|
|
static double[][][][][] _gunStats = new double[5][3][4][3][GF_ONE+1]; |
static double[][][][][][] _gunStats = new double[6][4][4][2][3][GF_ONE+1]; static final double LOG_BASE_E_TO_2_CONVERSION_CONSTANT = 1.4427; |
// setColors(Color.black, null, Color.white); |
setColors(Color.black, Color.black, Color.white); |
w.waveGuessFactors = _surfStats[(int)(Math.min((_lastDistance+50)/200, 3))][(int)((Math.abs(_lastLatVel?)+1)/2)]; |
w.waveGuessFactors = _nextSurfSegment?; |
_nextSurfSegment? = _surfStats[(int)(Math.min((_lastDistance+50)/200, 3))][(int)((Math.abs(_lastLatVel?)+1)/2)]; |
_lastGunOrientation? = w.orientation = sign((e.getVelocity())*Math.sin(e.getHeadingRadians() - _enemyAbsoluteBearing?)); |
double enemyLatVel?; _lastGunOrientation? = w.orientation = sign(enemyLatVel? = (e.getVelocity())*Math.sin(e.getHeadingRadians() - _enemyAbsoluteBearing?)); |
int bestGF = Math.min(2, (int)(Math.sqrt(153D*lastVChangeTime?++/_lastDistance))); // int bestGF = Math.min(2, (int)(Math.sqrt(120D*lastVChangeTime?++/_lastDistance))); // TC |
int bestGF = Math.min(3, (int)(Math.pow(280*lastVChangeTime?++/_lastDistance, .7))); // int bestGF = Math.min(3, (int)(Math.sqrt(220D*lastVChangeTime?++/_lastDistance))); // TC |
if (enemyVelocity != (newVelocity = (int)(Math.abs(e.getVelocity())))) { |
if (enemyVelocity != (newVelocity = (int)(enemyLatVel? = Math.abs(enemyLatVel?)))) { |
bestGF = 3; |
bestGF = 4; |
bestGF = 4; |
bestGF = 5; |
enemyVelocity = newVelocity; |
w.bulletVelocity = 14D; w.distance = -21; // w.bulletVelocity = 11D; // TC // w.distance = -16.5; |
w.waveGuessFactors = _gunStats[bestGF][(int)((enemyVelocity = newVelocity)/3)][gunWallDistance(0.15206139473) ? (gunWallDistance(0.30412278946) ? (gunWallDistance(0.45618418419) ? 3 : 2) : 1) : 0][(int)Math.min(2, _lastDistance/200)]; // w.waveGuessFactors = _gunStats[bestGF][(int)((enemyVelocity = newVelocity)/3)][gunWallDistance(.20358498553) ? (gunWallDistance(0.40716997107) ? (gunWallDistance(0.61075495659) ? 3 : 2) : 1) : 0][(int)Math.min(2, _lastDistance/200)]; // TC |
w.waveGuessFactors = _gunStats[bestGF][(int)(LOG_BASE_E_TO_2_CONVERSION_CONSTANT * Math.log(enemyLatVel? + 1.5))][gunWallDistance(0.18247367367) ? (gunWallDistance(0.36494734735) ? (gunWallDistance(0.63865785787) ? 3 : 2) : 1) : 0][gunWallDistance(-0.36494734735) ? 0 : 1][(int)limit(0, (_lastDistance-75)/200, 2)]; // w.waveGuessFactors = _gunStats[bestGF][(int)(LOG_BASE_E_TO_2_CONVERSION_CONSTANT * Math.log(enemyLatVel? + 1.5))][gunWallDistance(0.24430198263) ? (gunWallDistance(0.48860396528) ? (gunWallDistance(0.85505693924) ? 3 : 2) : 1) : 0][gunWallDistance(-0.48860396528) ? 0 : 1][(int)limit(0, (_lastDistance-75)/200, 2)]; // TC |
setTurnGunRightRadians?(Utils.normalRelativeAngle(_enemyAbsoluteBearing? - getGunHeadingRadians?() + ((_lastGunOrientation?*.02644545995)*(bestGF-GF_ZERO)) )); |
double power = 2 - Math.max(0, (30 - getEnergy()) / 16); // double power = 3; // TC w.distance = -1.5 * (w.bulletVelocity = (20 - 3*power)); setTurnGunRightRadians?(Utils.normalRelativeAngle(_enemyAbsoluteBearing? - getGunHeadingRadians?() + ((_lastGunOrientation?*(Math.asin(8/w.bulletVelocity)/GF_ZERO))*(bestGF-GF_ZERO)) )); |
if (getEnergy() > 2 && Math.abs(getGunTurnRemaining?()) < 3 && setFireBullet(2 + (_ramCounter / (3*getRoundNum?()+1))) != null) { |
if (Math.abs(getGunTurnRemaining?()) < 3 && setFireBullet(power + (_ramCounter / (3*getRoundNum?()+1))) != null) { |
_oppEnergy += e.getBullet().getPower() * 3; |
public void onBulletHit?(BulletHitEvent? e) { double bulletPower; _oppEnergy -= (bulletPower = e.getBullet().getPower()) * 4 + (Math.max(0, bulletPower - 1) * 2); } |
|