Browse Source

Added classwide debug flag

I don't have to constantly delete and re-add stuff
master
school 7 years ago
parent
commit
bc4bf88cab
  1. 11
      Ship.java

11
Ship.java

@ -2,6 +2,7 @@ import java.util.Arrays;
public class Ship{
public static final int X = 0;
public static final int Y = 1;
private static final boolean DEBUG = false;
private boolean vertical;
private int[] start;
private int[] end;
@ -175,13 +176,23 @@ public class Ship{
int c;
if (this.vertical){
for (c = this.start[Y];c <= this.end[Y];c++){
if (DEBUG) {
board[c][x_col] = this.length;
}
else {
board[c][x_col] = 4;
}
}
}
else {
for (c = this.start[X];c <= this.end[X];c++){
if (DEBUG) {
board[y_col][c] = this.length;
}
else {
board[y_col][c] = 4;
}
}
}
}
}
Loading…
Cancel
Save