|
|
|
|
|
|
|
|
* Die besten acht Teams qualifizieren sich für die Königsdisziplin „Rumble“. |
|
|
* Die besten acht Teams qualifizieren sich für die Königsdisziplin „Rumble“. |
|
|
*/ |
|
|
*/ |
|
|
public class SnakeBot extends Bot{ |
|
|
public class SnakeBot extends Bot{ |
|
|
String moves = ""; |
|
|
|
|
|
|
|
|
private String moves = ""; |
|
|
private int spiralNumber = 0; |
|
|
private int spiralNumber = 0; |
|
|
private boolean goesForward = true; |
|
|
private boolean goesForward = true; |
|
|
private boolean ignoreStones = false; |
|
|
private boolean ignoreStones = false; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private char goToStone(View view) { |
|
|
private char goToStone(View view) { |
|
|
|
|
|
|
|
|
int rowDifference = findStoneRow(view) - (view.width / 2); |
|
|
int rowDifference = findStoneRow(view) - (view.width / 2); |
|
|
return rowDifference < 0 ? '^' : '<'; |
|
|
return rowDifference < 0 ? '^' : '<'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
moves = moves.substring(1); |
|
|
moves = moves.substring(1); |
|
|
return nextMove; |
|
|
return nextMove; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |