Skip to content

Instantly share code, notes, and snippets.

@klod76
klod76 / robot.js
Created December 6, 2012 13:46
MmmMHHmmmm
var Robot = function(robot) {
this.direction = 1;
this.found = 0;
this.speed = 3;
};
Robot.prototype.onIdle = function(ev) {
var r = ev.robot;
@klod76
klod76 / robot.js
Created December 5, 2012 18:15
klod76_2
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.turn(10);
robot.ahead(25);
@klod76
klod76 / robot.js
Created December 5, 2012 17:05
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {
@klod76
klod76 / robot.js
Created December 5, 2012 13:43
klod76
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(15);
robot.rotateCannon(15);