//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
var noRobotSeen = 0;
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.turnRight(5);
noRobotSeen = noRobotSeen + 1
if (noRobotSeen = 4) {
noRobotSeen = 0;
while (onScannedRobot = false)
robot.turnLeft(5);
}
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.ahead();
robot.fire();
};