Skip to content

Instantly share code, notes, and snippets.

View spulec's full-sized avatar

Steve Pulec spulec

View GitHub Profile
@spulec
spulec / robot.js
Created December 1, 2012 02:21 — forked from heynemann/robot.js
Back and Forth
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@spulec
spulec / robot.js
Created December 1, 2012 02:11 — forked from cezarsa/robot.js
Simple Wall Robot
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {