|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class SnakeBot extends Bot{ |
|
|
public class SnakeBot extends Bot{ |
|
|
private String moves = ""; |
|
|
private String moves = ""; |
|
|
boolean frontIsBlocked, backIsBlocked, leftIsBlocked, rightIsBlocked, trapped; |
|
|
|
|
|
|
|
|
private boolean frontIsBlocked, backIsBlocked, leftIsBlocked, rightIsBlocked, trapped; |
|
|
private char previousTurn = '<'; |
|
|
private char previousTurn = '<'; |
|
|
private int spiralFactor = 1; |
|
|
private int spiralFactor = 1; |
|
|
private char spiralDirection = '>'; |
|
|
private char spiralDirection = '>'; |
|
|
private boolean goesForward = true; |
|
|
private boolean goesForward = true; |
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
Bot SnakeBot = new SnakeBot(args); |
|
|
|
|
|
SnakeBot.run(); |
|
|
|
|
|
|
|
|
Bot snakeBot = new SnakeBot(args); |
|
|
|
|
|
snakeBot.run(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected SnakeBot(String[] args) { |
|
|
protected SnakeBot(String[] args) { |