var _ = require('underscore');

// forest block
var F = {
  maxPopulationSize: 1000,
  bees: [{
    beetype: "A",
    population: 1000,
    rate: 0
  }, {
    beetype: "B",
    population: 1000,
    rate: 0
  }, {
    beetype: "C",
    population: 1000,
    rate: 0
  }, {
    beetype: "D",
    population: 1000,
    rate: 0
  }]
};

// crop block
var C = {
  "type": "crop - blueberry"
};

var field = [
  [F, C, C],
  [C, F, C],
  [C, C, C]
];

// DEFINITIONS
// a single forest isolated block would have negative rate of change

// need function to update rate of change and population
// need function to determine neighbor


// console.log(field[0][0]);


var qq = function(field) {

  // we assume that the field is a rectangle and not an irregular object
  var width = field[0].length;
  var height = field.length;

  // _(field).map(function(cell){
  // 	console.log(cell);
  // });


}





// console.log(field);

qq(field);
@@ -621,16 +621,373 @@
 eighbor%0A
+var neighbor = function(x, y) %7B%0A  var count = 0,%0A      i = x%3E0 ? x-1 : x,%0A      min_j = y%3E0 ? y-1 : y,%0A      max_i = (x%3E=field.length) ? x : x+1,%0A      max_j = (y%3E=field%5B0%5D.length) ? y : y+1;%0A%0A  for(; i %3C= max_i; i++)%7B%0A    for(var j=min_j; j %3C= max_j; j++)%7B%0A      if (i==x && j==y) continue;%0A      if(field%5Bi%5D%5Bj%5D == F) count++;%0A    %7D%0A  %7D%0A%0A  return count;%0A%7D%0A
 %0A%0A// con

Add neighbor function! * Hope this works