|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data.contains("*")) { |
|
|
if (data.contains("*")) { |
|
|
int index = data.indexOf('*'); |
|
|
int index = data.indexOf('*'); |
|
|
if (index < view.width * height / 2 && !(index > view.width * height / 2 + 1)) { |
|
|
|
|
|
|
|
|
if (index < width * height / 2 && index % width == 4) { |
|
|
|
|
|
return 'f'; |
|
|
|
|
|
} else if (index < width * height / 2 && !(index > width * height / 2 + 1)) { |
|
|
return safeMove(data); |
|
|
return safeMove(data); |
|
|
} else if (index % 5 < 2) { |
|
|
} else if (index % 5 < 2) { |
|
|
return '<'; |
|
|
return '<'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected char safeMove(String data) { |
|
|
protected char safeMove(String data) { |
|
|
if ("~#X".contains("" + data.charAt(35))) { |
|
|
if ("~#X".contains("" + data.charAt(35))) { |
|
|
|
|
|
currentStepCount = 2; |
|
|
return '>'; |
|
|
return '>'; |
|
|
} else { |
|
|
} else { |
|
|
return '^'; |
|
|
return '^'; |