Browse Source

Removed "magic numbers" by adding generateLeftSideArray and generateRightSideArray to SnakeBot.java. Added calculateCharIndexFromCoordinates function.

testing_N
Illia Soloviov 11 months ago
parent
commit
c88707fee9
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/RumbleBot.java

+ 4
- 2
src/RumbleBot.java View File

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…
Cancel
Save