Skip to content

Instantly share code, notes, and snippets.

@mrkschan
Created November 6, 2010 11:55
Show Gist options
  • Save mrkschan/665359 to your computer and use it in GitHub Desktop.
Save mrkschan/665359 to your computer and use it in GitHub Desktop.
import robocode.util.Utils;
import robocode.JuniorRobot;
public class Example extends JuniorRobot {
public void random_movement()
{
// get a random (X, Y) coordinate to move
gotoCoordinate(
Utils.getRandom().nextInt(fieldWidth),
Utils.getRandom().nextInt(fieldHeight)
);
}
:
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment