diff --git a/Battleship.java b/Battleship.java index 32c893b..82b686f 100644 --- a/Battleship.java +++ b/Battleship.java @@ -36,7 +36,7 @@ public class Battleship{ int[] boundTL = {0,0}; int[] boundBR = {board[0].length-1, board.length-1}; int length; - + int[] lengths = { 2, 3, diff --git a/Ship.java b/Ship.java index 7291063..c993749 100644 --- a/Ship.java +++ b/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,12 +176,22 @@ public class Ship{ int c; if (this.vertical){ for (c = this.start[Y];c <= this.end[Y];c++){ - board[c][x_col] = this.length; + 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++){ - board[y_col][c] = this.length; + if (DEBUG) { + board[y_col][c] = this.length; + } + else { + board[y_col][c] = 4; + } } } }