Browse Source

added evading shots

main
Illia Soloviov 10 months ago
parent
commit
fb2fa8507c
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/RumbleBot.java

+ 4
- 2
src/RumbleBot.java View File

@@ -51,13 +51,15 @@ public class RumbleBot extends Bot{

for (int index : leftIndexes) {
for (char enemy : enemies) {
if (view.data.charAt(index) == enemy) return '<';
if (view.data.charAt(index) == '>') return 'v';
else if (view.data.charAt(index) == enemy) return '<';
}
}

for (int index : rightIndexes) {
for (char enemy : enemies) {
if (view.data.charAt(index) == enemy) return '>';
if (view.data.charAt(index) == '<') return 'v';
else if (view.data.charAt(index) == enemy) return '>';
}
}


Loading…
Cancel
Save