Averages of 100 rounds, 1000 iterations:
Just my wolf and the standard mobs:
class animals.Bear - 2.2600002
class animals.Lion - 41.21
class animals.Stone - 20.159998
class animals.HerjanWolf - 99.99 <-- kind of flawless
Small Wolfgroup:
class animals.Bear - 1.0700002
class animals.Lion - 31.29
class animals.Stone - 23.97
class animals.HerjanWolf - 99.44999 <-- Who's boss
class animals.AlphaWolf - 92.83001
class animals.OmegaWolf - 98.55
Big Wolfgroup:
class animals.Bear - 0.11
class animals.Lion - 0.0
class animals.Stone - 3.21
class animals.AlphaWolf - 82.96001
class animals.HerjanWolf - 74.56999 <-- My score really sucks here though
class animals.GatheringWolf - 57.6
class animals.OmegaWolf - 88.36 <-- This one wins every game on this scale -.- Awesome moogie!
class animals.ShadowWolf - 79.83001
class animals.MOSHPITFRENZYWolf - 5.9399986
class animals.WolfWithoutFear - 11.209999
class animals.MimicWolf - 0.7
class animals.LazyWolf - 73.68999
class animals.Sheep - 41.72
class animals.HonorWolf - 81.91999
class animals.CamperWolf - 70.85998
class animals.GamblerWolf - 34.02999
My Wolf:
package animals;
public class HerjanWolf extends Animal {
private boolean lionTopLeft = false, lionTopLeftReady = false;
private boolean lionRight = false, lionRightReady = false;
private boolean lionBot = false, lionBotReady = false;
private boolean lionDanger = false, careful = true, firstmove = true;
private final int down = 1, right = 2, left = 3, up = 4;
public HerjanWolf() {
super('W');
}
public Attack fight(char c){
switch (c) {
case 'B':
return Attack.SCISSORS;
case 'L':
return Attack.SCISSORS;
case 'S':
return Attack.PAPER;
default:
int rand = (int) (Math.random()*3);
if(rand < 1)
return Attack.PAPER;
else if(rand < 2)
return Attack.SCISSORS;
else
return Attack.ROCK;
}
}
public Move move() { //surroundings[y][x]
checkLions();
if(firstmove){
if(surroundings[2][0] == 'L')
lionBotReady = true;
if(surroundings[0][2] == 'L')
lionRightReady = true;
firstmove = false;
}
if(lionDanger || surroundings[1][0] == 'L' && lionTopLeftReady || surroundings[0][1] == 'L' && lionTopLeftReady){
if (isSafe(1, 2) && surroundings[0][2] != 'W'){
newMove(right);
return Move.RIGHT;
}else if (isSafe(2, 1)){
newMove(down);
return Move.DOWN;
}else if (isSafe(0, 1)){
newMove(up);
return Move.UP;
}else if (isSafe(1, 0)){
newMove(left);
return Move.LEFT;
}else if(isSafe(1,2)){
newMove(right);
return Move.RIGHT;
}
newMove(left);
return Move.LEFT;
}
return Move.HOLD;
}
boolean isSafe(int y, int x){
if(y <= 1){
if(x <= 1){
if(surroundings[y][x] != 'W' && !lionTopLeft)
return true;
}else if(surroundings[1][2] != 'W' && !lionRightReady)
return true;
}else if(surroundings[2][1] != 'W' && !lionBotReady)
return true;
return false;
}
public void checkLions(){
int y = 0, x = 0;
if(lionTopLeft)
lionTopLeftReady = true;
else
lionTopLeftReady = false;
if(surroundings[y][x] == 'L')
lionTopLeft = true;
else
lionTopLeft = false;
if(lionRight)
lionRightReady = true;
else
lionRightReady = false;
if(surroundings[y][x+1] == 'L') // && !lionTopLeftReady
lionRight = true;
else
lionRight = false;
if(lionBot)
lionBotReady = true;
else
lionBotReady = false;
if(surroundings[y+1][x] == 'L' && !lionTopLeftReady)
lionBot = true;
else
lionBot = false;
if(careful){
if(surroundings[y+1][x] == 'L'){
lionDanger = true;
}else if(surroundings[y][x+1] == 'L'){
lionDanger = true;
}
careful = false;
}
}
public void newMove(int move){
lionTopLeft = false;
lionRight = false;
lionBot = false;
lionTopLeftReady = false;
lionRightReady = false;
lionBotReady = false;
lionDanger = false;
if(move == down){
if(surroundings[1][0] == 'L')
lionTopLeft = true;
if(surroundings[2][0] == 'L')
lionBot = true;
}else if(move == right){
if(surroundings[0][1] == 'L')
lionTopLeft = true;
if(surroundings[0][2] == 'L')
lionRight = true;
}else
careful = true;
}
}
Again thanks for telling me about this Pizza, it was fun!
EDIT:
At the main topic where my wolf is posted I updated my wolf a little bit so that it has an avg of 85+ in large groups.