Browse Source

RumbleBot random turn

master
Your Average Code 11 months ago
parent
commit
13955b7b29
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/RumbleBot.java

+ 4
- 1
src/RumbleBot.java View File

protected char walkAround(char[][] grid) { protected char walkAround(char[][] grid) {
if (steps == 0) { if (steps == 0) {
steps = random.nextInt(20); steps = random.nextInt(20);
return '>';
if(random.nextBoolean())
return '<';
else
return '>';
} else { } else {
steps--; steps--;
return safeMove(grid); return safeMove(grid);

Loading…
Cancel
Save