Skip to content

Instantly share code, notes, and snippets.

@mdonahoo
mdonahoo / robot.js
Created December 3, 2012 19:59
WALL GRABBER
var northAngle = 360;
var westAngle = 90;
var southAngle = 180;
var eastAngle = 270;
var turnedNorth = false;
var turnedWest = false;
var turnedEast = false;
var turnedSouth = false;
var stopRotating = false;
var minRotation = 0;
@mdonahoo
mdonahoo / robot.js
Created December 3, 2012 23:17
Zigzagger
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.movementFn = 'ahead';
this.turnMultiplier = 1;
this.cannonTurn = 45;
};
@mdonahoo
mdonahoo / robot.js
Created December 3, 2012 23:19
CodeFist
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {};
var target = null;
var intelAge = 0;
function log1(value, caption)
{
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 00:06 — forked from marcelcaraciolo/robot.js
Crusher
//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.turn(360);
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 07:58 — 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) {
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 08:04 — forked from randompast/robot.js
QR-bot-009
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var rx = robot.position.x;
var ry = robot.position.y;
var aH = robot.arenaHeight;
var aW = robot.arenaWidth;
robot.clone()
};
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 08:21 — forked from randompast/robot.js
QR-bot-009
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var rx = robot.position.x;
var ry = robot.position.y;
var aH = robot.arenaHeight;
var aW = robot.arenaWidth;
robot.clone()
};
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 22:22 — forked from m1ko/robot.js
pan rozowy wons
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
for(var i=0;i<5;i++)
{
robot.move(60);
robot.turn(45);
@mdonahoo
mdonahoo / robot.js
Created December 4, 2012 22:30 — forked from gabrielgarciagava/robot.js
RoboTosco
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.clone();
};
var girar = 1;
var count = 0;