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

This commit is contained in:
Illia Soloviov 2024-01-07 19:18:10 +01:00
parent 477e16cede
commit c88707fee9

View File

@ -17,13 +17,15 @@ public class RumbleBot extends Bot{
super(args);
}
//@TODO: add nextMove() logic
protected char nextMove(View view){
return walk(); //@TODO: add nextMove() logic
return walk();
}
//@TODO: add walk() logic
private char walk() {
if(moves.isEmpty()){
moves += ' '; //@TODO: add walk() logic
moves += ' ';
}
char nextMove = moves.charAt(0);
moves = moves.substring(1);