Skip to content

Instantly share code, notes, and snippets.

@willyph
Created December 3, 2012 17:54
Show Gist options
  • Save willyph/4196712 to your computer and use it in GitHub Desktop.
Save willyph/4196712 to your computer and use it in GitHub Desktop.
Curly & Moe
//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(200);
robot.turn(45);
robot.fire();
robot.rotateCannon(90);
robot.back(150);
robot.turn(45);
robot.fire();
robot.rotateCannon(90);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
robot.back(25);
robot.fire();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment