## Hunter-Killer ##

	function(myself, grid, bots, gameInfo) {
		targetColour = myself[0] % 3;
		// If I can paint someone else's space to my colour, do so.
		var options = [];
		if (myself[1] !== 0 && grid[myself[1] - 1][myself[2]] % 3 === targetColour && grid[myself[1] - 1][myself[2]] !== myself[0] && grid[myself[1] - 1][myself[2]] !== 0)
			options.push("left");
		if (myself[1] !== grid.length - 1 && grid[myself[1] + 1][myself[2]] % 3 === targetColour && grid[myself[1] + 1][myself[2]] !== myself[0] && grid[myself[1] + 1][myself[2]] !== 0)
			options.push("right");
		if (myself[2] !== 0 && grid[myself[1]][myself[2] - 1] % 3 === targetColour && grid[myself[1]][myself[2] - 1] !== myself[0] && grid[myself[1]][myself[2] - 1] !== 0)
			options.push("up");
		if (myself[2] !== grid.length - 1 && grid[myself[1]][myself[2] + 1] % 3 === targetColour && grid[myself[1]][myself[2] + 1] !== myself[0] && grid[myself[1]][myself[2] + 1] !== 0)
			options.push("down");
		if (options.length > 0) return options[Math.random() * options.length | 0];
		
		// Otherwise, move to the closest bot I can paint over.
		var targetBots = bots.filter(bot => {
			if (bot[0] === myself[0] || bot[0] % 3 !== targetColour) return false;
			return true;
		});
		if (targetBots.length > 0) {
			targetBots.sort((a, b) => (Math.abs(a[1] - myself[1]) + Math.abs(a[2] - myself[2])) < (Math.abs(a[1] - myself[1]) + Math.abs(a[2] - myself[2])));
			if (Math.abs(targetBots[0][1] - myself[1]) > Math.abs(targetBots[0][2] - myself[2])){
				return targetBots[0][1] - myself[1] > 0 ? "right" : "left";
			}
			return targetBots[0][2] - myself[2] > 0 ? "down" : "up";
		}
		
		options = [];
		// If we've killed them all, try to move to a blank space.
		if (myself[1] !== 0 && grid[myself[1] - 1][myself[2]] === 0 && grid[myself[1] - 1][myself[2]] !== myself[0])
			options.push("left");
		if (myself[1] !== grid.length - 1 && grid[myself[1] + 1][myself[2]] === 0 && grid[myself[1] + 1][myself[2]] !== myself[0])
			options.push("right");
		if (myself[2] !== 0 && grid[myself[1]][myself[2] - 1] === 0 && grid[myself[1]][myself[2] - 1] !== myself[0])
			options.push("up");
		if (myself[2] !== grid.length - 1 && grid[myself[1]][myself[2] + 1] === 0 && grid[myself[1]][myself[2] + 1] !== myself[0])
			options.push("down");
		if (options.length > 0) return options[Math.random() * options.length | 0];
		
		options = [];
		// If there aren't any, try to move to a space I can paint white.
		targetColour = (targetColour + 2) % 3
		if (myself[1] !== 0 && grid[myself[1] - 1][myself[2]] % 3 === 0 && grid[myself[1] - 1][myself[2]] !== myself[0])
			options.push("left");
		if (myself[1] !== grid.length - 1 && grid[myself[1] + 1][myself[2]] % 3 === 0 && grid[myself[1] + 1][myself[2]] !== myself[0])
			options.push("right");
		if (myself[2] !== 0 && grid[myself[1]][myself[2] - 1] % 3 === 0 && grid[myself[1]][myself[2] - 1] !== myself[0])
			options.push("up");
		if (myself[2] !== grid.length - 1 && grid[myself[1]][myself[2] + 1] % 3 === 0 && grid[myself[1]][myself[2] + 1] !== myself[0])
			options.push("down");
		if (options.length > 0) return options[Math.random() * options.length | 0];
		
		// Otherwise, pick one at random.
		return ["up","down","left","right"][Math.random() * 4 | 0];
	}

Hunter-Killer targets the closest bot that it can paint over and tries to paint over all of its spaces, eliminating it.  If it gets all of them, it reverts to a random-painting algorithm where it tries to move first to white spaces and second to spaces it can make white.

It seems to do well if it can latch on to a bot that has a good strategy and follow it for a while, but only moderate if it kills all of its targets quickly (or its targets are weak bots).

Doesn't work well with the current version of the controller, as bots aren't removed when eliminated.  If that's not changed, I'll rewrite it to ignore bots which haven't moved in a few turns (potentially allowing a turtleing strategy which would allow a bot to survive, though likely not prosper).

All that's required to fix this is change the first loop in runBots to

	for (var j = 0; j < botData.length; j++) {
		if (!botData[j].eliminated)
			bots_array.push([botData[j].uid, botData[j].x, botData[j].y]);
	}