Skip to content

Instantly share code, notes, and snippets.

@diasbruno
Created December 6, 2012 23:36
Show Gist options
  • Save diasbruno/4229429 to your computer and use it in GitHub Desktop.
Save diasbruno/4229429 to your computer and use it in GitHub Desktop.
Tstr
//
// Delete this when available.
//
var Robot=function(r){r.clone();},RP=Robot.prototype;
RP.onIdle=function(e){e.robot.ahead();e.robot.rotateCannon(1);}
RP.onScannedRobot=function(e){e.robot.fire();}
RP.onRobotCollision=
RP.onWallCollision=function(e){e.robot.turn(-90+Math.random()*e.bearing);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment