src/main/java/com/brianscottrussell/gameoflife/GameGrid.java
/**
     * Builds a String representation of the GameGrid
     */
Builds a String representation of the GameGrid
Builds a String representation of the GameGrid
public String asString() {
        StringBuilder output = new StringBuilder();
        if(null != this.grid) {
            for (int row = 0; row < this.rowCount; row++) {
                for (int col = 0; col < this.colCount; col++) {
                    if (row != 0 && col == 0) {
                        output.append(GameOfLife.LF);
                    }
                    output.append(isCellInGrid(row, col) ? this.grid[row][col].getSymbol() : '_');
                }
            }
        }
        return output.toString();
    }
public String asString ( ) { StringBuilder output = new StringBuilder ( ) ; if ( null != this . grid ) { for ( int row = 0 ; row < this . rowCount ; row ++ ) { for ( int col = 0 ; col < this . colCount ; col ++ ) { if ( row != 0 && col == 0 ) { output . append ( GameOfLife . LF ) ; } output . append ( isCellInGrid ( row , col ) ? this . grid [ row ] [ col ] . getSymbol ( ) : '_' ) ; } } } return output . toString ( ) ; }
Builds a String representation of the GameGrid
Builds a String representation of the GameGrid
// TODO: can do better than O(n^2)? // if this is not the 1st row, and is the 1st column of the row, add return carriage