KOTH: A world-wide pandemic
TrumpBot
private void sleep(String[] args) {
round = Integer.parseInt(args[0]);
thisTownID = Integer.parseInt(args[1]);
states = new ArrayList<>();
//states.add(new State(args[thisTownID+2]));
otherStates = new ArrayList<>();
for (int i = 2; i < args.length; i++){
states.add(new State(args[i]));
}
for (State state : states){
if (state.ownerId == thisTownID) {
thisState = state;
} else {
otherStates.add(state);
}
}
StringBuilder cmd = new StringBuilder();
for (int j =0;j<3;j++){
if (thisState.infected > 7) {
if (thisState.infected > 25){
cmd.append("Q");
thisState.infected -= 30;
}
else {
cmd.append("C");
thisState.infected -= 10;
}
}
else if (thisState.migrationRate > 2) {
cmd.append("B");
thisState.migrationRate -= 10;
}
else if (thisState.infectionRate > 4) {
cmd.append("M");
thisState.infectionRate -= 4;
}
else if (thisState.contagionRate > 10 || thisState.lethalityRate > 6 || thisState.infectionRate > 0) {
cmd.append("V");
thisState.contagionRate -= 4;
thisState.lethalityRate -= 2;
thisState.infectionRate -= 1;
}
else if (thisState.infected % 10 <= 6){
cmd.append("T");
thisState.infected +=4;
}
else cmd.append("V");
}
System.out.print(cmd.reverse());
}
Makes America great by curing all the infected unless there are only 2 or less; minorities will be ignored.
Having less infections makes the medicine cheaper.
Needs no immigrants – they only bring infection.
If there is nothing left to do, bomb the other players.
Reversed command order to the American way, bombs first cure people later.
Edit: fixed a bug that would spam cures because the infected count wasn't lowered after curing.
Trumpscript
Thanks to J Atkin for providing it:
Make turn 4000000
As long as, turn larger than 1000000;:
If, refugee count > 2000000;: say "C"!
Else if, infectionRate > 200000;: say "M"!
Else if, immigration rate > 9000000;: say "B"!
Else: say "T"!
Make turn old turn - 1000000!
America is Great.
AllOrNothing, R
args <- strsplit(commandArgs(TRUE),";")[[1]]
round <- as.integer(args[1])
me <- as.integer(args[2])
stats <- do.call(rbind,strsplit(args[-(1:2)],"_"))
stats <- as.data.frame(apply(stats,2,as.integer))
colnames(stats) <- c("id","Sane","Infected","Dead","InfRate","ContRate","LethRate","MigRate")
out <- ""
statme <- stats[stats$id==me,]
while(nchar(out)<3){
if(round==1 & !nchar(out)){
out <- paste0(out, "B")
}else if(round%%5==4 & statme$Infected > 20){
statme$Infected <- statme$Infected - 30
out <- paste0(out, "Q")
}else if(statme$Sane*statme$InfRate/100 >= 1){
o <- ifelse(statme$Sane*statme$InfRate/100 < statme$Infected*statme$ContRate/100, "C", "M")
if(o=="C") statme$Infected <- statme$Infected - 10
if(o=="M") statme$InfRate <- statme$InfRate - 4
out <- paste0(out, o)
}else if(statme$Infected > 0){
statme$Infected <- statme$Infected - 10
out <- paste0(out, "C")
}else if(median(stats$LethRate)<20){
out <- paste0(out, "W")
}else{
out <- paste0(out, "E")
}
}
cat(substr(out,1,3))
Invoked by Rscript AllOrNothing.R
.
The idea here is on one hand to limit to the maximum the risk of infection (by lowering infection rate, curing the infected and preventing infected to immigrate) and on the other hand to increase the lethality of the disease so that the people that do get infected, die before contaminating the others.
Edit: tweaked the strategy a little.
Medic
The Medic was always... troubled, so to speak, by the people without medicine. He loves to practice medicine, so that's all he does. He also likes pythons, so he wrote his code in Python. It all makes sense, if you think about it. No, it really doesn't. Actually, it kinda does...
from random import *
commands = ""
while len(commands) < 3:
chance = random()
if chance < .5: commands += "V"
elif chance < .66: commands += "I"
elif chance < .84: commands += "E"
else: commands += "M"
print(commands)
I am here to help.