Skip to content

Instantly share code, notes, and snippets.

@changtimwu
Created December 7, 2012 01:55
Show Gist options
  • Select an option

  • Save changtimwu/4230102 to your computer and use it in GitHub Desktop.

Select an option

Save changtimwu/4230102 to your computer and use it in GitHub Desktop.
Gnome 3310
//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(40);
robot.turn(40);
//robot.rotateCannon(360);
robot.back(40);
robot.turn(40);
robot.rotateCannon(90);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire(20);
robot.turn(90);
robot.back(100);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment