MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 24224
    denis
    created 01/24/18 23 code lines fight
    1485 SCORE
    0 KILLS
    4 SHOTS
    2 HITS
    40.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • # 24852
    denis
    created 01/24/18 94 code lines fight fork
    1455 SCORE
    1 KILLS
    9 SHOTS
    7 HITS
    70.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    // Store all of the robots and their states so // that they can be referenced throughout the robots var ROBOT_STATES = {} // states // find and attack enemy with reckless abandon var SEEK = { onIdle: function(ev) { ev.robot.turn(360); }, onScannedRobot: function(ev) { changeState(ev.robot, DESTROY); } } var DESTROY = { onIdle: function(ev) { changeState(ev.robot, SEEK); }, onScannedRobot: function(ev) { if (friends(ev.robot, ev.scannedRobot)) { return; } ev.robot.move(); ev.robot.fire(); } } // common state behavior function friends(robot1, robot2) { return robot1.parentId == robot2.id || robot1.id == robot2.parentId; } // wiring robots to states var Robot = function(robot) { robot.clone(); } Robot.prototype.onIdle = function(ev) { state(ev.robot).onIdle(ev); }; Robot.prototype.onScannedRobot = function(ev) { state(ev.robot).onScannedRobot(ev); }; Robot.prototype.onHitByBullet = function(ev) { state(ev.robot).onHitByBullet(ev); }; Robot.prototype.onWallCollision = function(ev) { state(ev.robot).onWallCollision(ev); }; Robot.prototype.onRobotCollision = function(ev) { state(ev.robot).onRobotCollision(ev); }; // state machine function changeState(robot, state) { ROBOT_STATES[robot] = state; bindEvents(robot, state); } function bindEvents(robot, state) { var all_events = [ 'onIdle', 'onScannedRobot', 'onRobotCollision', 'onWallCollision', 'onHitByBullet' ]; for (var event in all_events) { if (event in state) { robot.listen(event); } else { robot.ignore(event); } } } function determineFirstState(robot) { return SEEK; } function state(robot) { if (!(robot in ROBOT_STATES)) { // set up initial state ROBOT_STATES[robot] = determineFirstState(robot); } return ROBOT_STATES[robot]; }
  • # 24545
    Denis
    created 01/24/18 20 code lines fight fork
    1471 SCORE
    0 KILLS
    20 SHOTS
    9 HITS
    42.86%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //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); robot.rotateCannon(360); robot.back(100); robot.rotateCannon(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 463
    Denis
    created 01/24/18 20 code lines fight fork
    1528 SCORE
    2 KILLS
    20 SHOTS
    20 HITS
    95.24%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //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); robot.rotateCannon(360); robot.back(100); robot.rotateCannon(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 218
    HACKER
    created 02/01/18 40 code lines fight fork
    1559 SCORE
    8 KILLS
    265 SHOTS
    92 HITS
    34.59%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(r) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; }; r.rotateCannon(2); r.fire(); r.turn(8); r.rotateCannon(-20); r.ahead(15); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); };
  • # 423
    HACKER
    created 02/01/18 40 code lines fight fork
    1530 SCORE
    2 KILLS
    117 SHOTS
    21 HITS
    17.80%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(r) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; }; r.rotateCannon(2); r.fire(); r.turn(8); r.rotateCannon(-20); r.ahead(15); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); };
  • # 421
    scscs
    created 02/01/18 40 code lines fight fork
    1530 SCORE
    3 KILLS
    40 SHOTS
    24 HITS
    58.54%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(r) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; }; r.rotateCannon(2); r.fire(); r.turn(8); r.rotateCannon(-20); r.ahead(15); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); };
  • # 606
    v
    created 02/01/18 40 code lines fight fork
    1515 SCORE
    1 KILLS
    20 SHOTS
    12 HITS
    57.14%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    ///FightCode can only understand your robot //if its class is called Robot var Robot = function(r) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; }; r.rotateCannon(2); r.fire(); r.turn(8); r.rotateCannon(-20); r.ahead(15); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); };
  • # 96
    vsvs
    created 02/01/18 40 code lines fight fork
    1588 SCORE
    10 KILLS
    175 SHOTS
    72 HITS
    40.91%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(r) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; }; r.rotateCannon(2); r.fire(); r.turn(8); r.rotateCannon(-20); r.ahead(15); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); };

LATEST COMBATS

WATCH THE LAST COMBATS OF THIS PLAYER'S ARMY