5 errors, who can help me?

Jump to navigation Jump to search
Edited by author.
Last edit: 22:01, 21 May 2014

What You Want To Do Is Say. Remember The Solution To The Error Repeatedly. And Then The Answer Will Come To You. In Other Words Rememberance http://www.epiphaniesinc.com/blog/2008/02/a-simple-buddhist-mind-trick-to-help-you-remember-your-best-solutions/

Tmservo (talk)21:52, 21 May 2014

How far are you

Tmservo (talk)21:59, 21 May 2014

Trying to find a solution for

Compiling...


1. ERROR in C:\robocode\robots\Yeah.java (at line 21) setAhead(direction*36*Math.max(0,Math.signum(prevEnergy-e.getEnergy()))); ^^^^^^^^^ direction cannot be resolved to a variable


1 problem (1 error) Compile Failed (-1)


Not able to find a solution.. :(

Gertjan1996 (talk)22:00, 21 May 2014

Read The Tutorials as CAREFULLY as possible

Tmservo (talk)22:02, 21 May 2014

Finally. Solved the problem :D Now i have a working radar and the Stop And Go movement.

Do I now only have to add the GuessFactor Targeting?

Gertjan1996 (talk)22:05, 21 May 2014

Skip Anti Gravity And Go straight To guessfactor targeting

Tmservo (talk)22:07, 21 May 2014

Where do I have to add the new class Wave Bullet?

Gertjan1996 (talk)22:18, 21 May 2014

examine this code carefully

import java.awt.geom.*;
import robocode.util.Utils;
 
public class WaveBullet
{
	private double startX, startY, startBearing, power;
	private long   fireTime;
	private int    direction;
	private int[]  returnSegment;
 
	public WaveBullet(double x, double y, double bearing, double power,
			int direction, long time, int[] segment)
	{
		startX         = x;
		startY         = y;
		startBearing   = bearing;
		this.power     = power;
		this.direction = direction;
		fireTime       = time;
		returnSegment  = segment;
	}
Tmservo (talk)22:24, 21 May 2014

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:User talk:Gertjan1996/5 errors, who can help me?/reply (18).

Just compile it and see what happens

Tmservo (talk)22:31, 21 May 2014

How to solve this..

Compiling...


1. ERROR in C:\robocode\robots\Yeah.java (at line 26) public class WaveBullet ^^^^^^^^^^ The public type WaveBullet must be defined in its own file


1 problem (1 error) Compile Failed (-1)

Source code right now:

import robocode.AdvancedRobot; import robocode.ScannedRobotEvent; import java.awt.geom.*; import robocode.util.Utils;

public class Yeah extends AdvancedRobot { public void run() {

  turnRadarRightRadians(Double.POSITIVE_INFINITY);
  do {
      scan();
  } while (true);

} static double prevEnergy = 100.0; public void onScannedRobot(ScannedRobotEvent e) {

  double radarTurn =
      // Absolute bearing to target
      getHeadingRadians() + e.getBearingRadians()
      // Subtract current radar heading to get turn required
      - getRadarHeadingRadians();
  setTurnRadarRightRadians(Utils.normalRelativeAngle(radarTurn));

{ //energy monitoring

	if(prevEnergy > (prevEnergy = e.getEnergy()) && getDistanceRemaining() == 0.0);

} } }

public class WaveBullet { private double startX, startY, startBearing, power; private long fireTime; private int direction; private int[] returnSegment;

public WaveBullet(double x, double y, double bearing, double power, int direction, long time, int[] segment) { startX = x; startY = y; startBearing = bearing; this.power = power; this.direction = direction; fireTime = time; returnSegment = segment; } }

Gertjan1996 (talk)22:37, 21 May 2014

You need To make a Robot That Uses Multiple Java files

Tmservo (talk)22:39, 21 May 2014