Skip to content

Instantly share code, notes, and snippets.

View cezarsa's full-sized avatar

Cezar Sá Espinola cezarsa

  • Brasília - DF / Brazil
  • 09:40 (UTC -03:00)
View GitHub Profile
@cezarsa
cezarsa / robot.js
Created November 30, 2012 16:36 — forked from heynemann/robot.js
seeker
var robotData = {};
var isClone = function(r) {
return !!r.parentId;
};
var isRelated = function(r1, r2) {
return r1.id == r2.parentId || r1.parentId == r2.id;
};
var set = function(r, k, v) {
robotData[r.id] = robotData[r.id] || {};
robotData[r.id][k] = v === undefined ? true : v;
@cezarsa
cezarsa / robot.js
Created November 30, 2012 02:38
test2
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 30, 2012 02:31
test
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 30, 2012 02:29
sitting bot
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 30, 2012 01:54
test
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 29, 2012 23:07
Dummy bot
//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.ahead(100);
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 29, 2012 04:03
Evil Chatter
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 29, 2012 03:54
Ahoy Bot
//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.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 28, 2012 16:03
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) {