Skip to content

Instantly share code, notes, and snippets.

@pawel220
Created December 4, 2012 17:26
Show Gist options
  • Save pawel220/4206522 to your computer and use it in GitHub Desktop.
Save pawel220/4206522 to your computer and use it in GitHub Desktop.
PAPIEZ
//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.fire();
robot.ahead(50);
robot.fire();
robot.turn(10);
robot.fire();
robot.rotateCannon(36);
robot.fire();
robot.back(10);
robot.fire();
robot.turn(10);
robot.fire();
robot.rotateCannon(36);
robot.fire();
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
robot.fire();
robot.fire();
robot.fire();
robot.fire();
Robot.prototype.onWallCollision = function(ev) {
robot.turn(100);
robot.fire();
robot.ahead(50)};
robot.fire();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment