Browse Source

SnakeBot reformat

master
Your Average Code 11 months ago
parent
commit
e408032f5d
1 changed files with 4 additions and 6 deletions
  1. 4
    6
      src/SnakeBot.java

+ 4
- 6
src/SnakeBot.java View File

protected int steps = 0; protected int steps = 0;


public static void main(String[] args) { public static void main(String[] args) {
Bot bot = new SnakeBot(args);
bot.run();
Bot bot = new SnakeBot(args);
bot.run();
} }


protected SnakeBot(String[] args) { protected SnakeBot(String[] args) {
int rightStars = 0; int rightStars = 0;
for (int x = 0; x < size / 2; x++) { for (int x = 0; x < size / 2; x++) {
for (int y = 0; y < size; y++) { for (int y = 0; y < size; y++) {
if (grid[x][y] == '*')
leftStars++;
if (grid[size - x - 1][y] == '*')
rightStars++;
if (grid[x][y] == '*') leftStars++;
if (grid[size - x - 1][y] == '*') rightStars++;
} }
} }



Loading…
Cancel
Save