Skip to content

Commit

Permalink
minor fix to printing of grid in console
Browse files Browse the repository at this point in the history
  • Loading branch information
LToothbrush committed May 1, 2024
1 parent 388825e commit 435f293
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/main/java/com/cse3310/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,21 +209,20 @@ else if(dY == -1)
System.out.println("Horizontals: " + (horizontals/index));
System.out.println("Downward verticals: " + (vertDown/index));
System.out.println("Upward verticals:" + (vertUp/index));
System.out.println(" Actual Density: " + (double) validWordsLetters / (length * width));

// Fill in rest of the grid with random letters
// Print grid
// Print grid to console for debugging
for (int i = 0; i < width; i++) {
for (int j = 0; j < length; j++) {
if (grid[i][j] == 0) {
if (grid[i][j] == 0)
{

grid[i][j] = alphabet.charAt(rand.nextInt(alphabet.length()));
System.out.printf(" |");

}
else
{


System.out.printf("" + grid[i][j] + "|");
}


}
System.out.println();
Expand Down

0 comments on commit 435f293

Please sign in to comment.