Removed "magic numbers" by adding generateLeftSideArray and generateRightSideArray to SnakeBot.java. Added calculateCharIndexFromCoordinates function.
This commit is contained in:
parent
477e16cede
commit
c88707fee9
@ -17,13 +17,15 @@ public class RumbleBot extends Bot{
|
|||||||
super(args);
|
super(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@TODO: add nextMove() logic
|
||||||
protected char nextMove(View view){
|
protected char nextMove(View view){
|
||||||
return walk(); //@TODO: add nextMove() logic
|
return walk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@TODO: add walk() logic
|
||||||
private char walk() {
|
private char walk() {
|
||||||
if(moves.isEmpty()){
|
if(moves.isEmpty()){
|
||||||
moves += ' '; //@TODO: add walk() logic
|
moves += ' ';
|
||||||
}
|
}
|
||||||
char nextMove = moves.charAt(0);
|
char nextMove = moves.charAt(0);
|
||||||
moves = moves.substring(1);
|
moves = moves.substring(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user