Java Guardian
The Guardian protects the weak. He will attack whoever spent their last turn picking on the now-weakest living bot (besides possibly himself). He's smart enough, though, to not attack:
Himself (unless he is the bully, then he feels that he deserves it.)
Bots who attack themselves
Dead bots
Bots with less than ten life left (who have hopefully learned their lessons!)
The Guardian will pick on the same player repeatedly if needed.
Ties for "weakest player" and "who picked on him" both go to the first one in the list.
public class Guardian{
public static void main (String[] args){
if(args.length == 0){
System.out.print("ok");
System.exit(0);
}
String myId = args[0];
int lowestLife = Integer.MAX_VALUE;
String[] tokens = {};
String opposingId = "";
String weakestOpponent = "";
String lastTarget = "";
for(int i=1; i<args.length; i++){
tokens = args[i].split(",");
otherId = tokens[0];
life = Integer.ValueOf(tokens[1]);
lastTarget = tokens[3];
if(life < lowestLife && life > 0 &&
!other.equals(myId) &&
!other.equals(lastTarget)){
weakestOpponent = otherId;
}
}
for(int i=1; i<args.length; i++){
tokens = args[i].split(",");
otherId = tokens[0];
life = Integer.ValueOf(tokens[1]);
lastTarget = tokens[3];
if (lastTarget.equals(weakestOpponent) &&
life > 10){
System.out.println(otherId);
System.exit(0);
}
}
Sytem.out.println("D");
}
}