Skip to content

Instantly share code, notes, and snippets.

@serby
Created December 6, 2012 16:43
Show Gist options
  • Select an option

  • Save serby/4225920 to your computer and use it in GitHub Desktop.

Select an option

Save serby/4225920 to your computer and use it in GitHub Desktop.
Serby
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(Math.round(Math.random() * n));
robot.rotateCannon(rnd(360));
robot.back(rnd(100));
robot.rotateCannon(rnd(360));
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
};
@domdoescode

Copy link
Copy Markdown

Whatever this is, I approve.

@serby

serby commented Dec 7, 2012

Copy link
Copy Markdown
Author

The hutdog hooked me up: http://fightcodegame.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment