index.js
function _setState (lattice, size) {
    for (var num = 0; num < size; num++) {
      var cell = {}
      cell.state = getRandomState()
      lattice.push(cell)
    }

    return lattice
  }
function _setState (lattice, size) {
    for (var num = 0; num < size; num++) {
      var cell = {}
      cell.state = getRandomState()
      lattice.push(cell)
    }

    return lattice
  }
function _setState ( lattice , size ) { for ( var num = 0 ; num < size ; num ++ ) { var cell = { } cell . state = getRandomState ( ) lattice . push ( cell ) } return lattice }
get a random state and create all cells
get a random state and create all cells