Skip to content

Instantly share code, notes, and snippets.

@floribon
Created December 5, 2012 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floribon/4215350 to your computer and use it in GitHub Desktop.
Save floribon/4215350 to your computer and use it in GitHub Desktop.
Test
function Robot() {}
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
robot.turn(1);
robot.fire();
};
Robot.prototype.onWallCollision = function(ev) {
var robot = ev.robot();
robot.back(100);
};
Robot.prototype.onRobotCollision = function(ev) {
var robot = ev.robot();
robot.turn(10);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment