Skip to content

Instantly share code, notes, and snippets.

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