DummyBot more options

This commit is contained in:
Your Average Code 2024-01-25 14:18:12 +01:00
parent 475e5c1c5d
commit 0410084441

View File

@ -14,9 +14,19 @@ public class DummyBot extends Bot {
@Override @Override
protected char nextMove(View view) { protected char nextMove(View view) {
return switch (random.nextInt(3)) { String data = view.data
.replace('^', '*')
.replace('<', '*')
.replace('>', '*')
.replace('v', '*');
if (data.contains("*") && random.nextFloat() < 0.8)
return 'f';
return switch (random.nextInt(10)) {
case 1 -> '<'; case 1 -> '<';
case 2 -> '>'; case 2 -> '>';
case 3 -> 'v';
default -> '^'; default -> '^';
}; };
} }