-- http://www.codewars.com/kata/534e01fbbb17187c7e0000c6
var spiralize = function(size) {
  var ret = [];
  for(var i=0; i<size; i++){
    ret[i] = [];
    for(var j=0; j<size; j++){
      var coil = Math.min.apply(this, [i, j, size-1-i, size-1-j]);
      var odd = coil % 2;
      ret[i][j] = +(!odd && !(i==coil+1 && j==coil) || odd && i==coil+1 && j==coil);
    }
  }
  return ret;
}