Skip to content

Instantly share code, notes, and snippets.

@ksipe
Created December 4, 2012 17:35
Show Gist options
  • Save ksipe/4206638 to your computer and use it in GitHub Desktop.
Save ksipe/4206638 to your computer and use it in GitHub Desktop.
Q
//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(8);
robot.turn(3);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.stop();
robot.fire(5);
robot.rotateCannon(-30);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment