var Minesweeper = function(){
	
}

Minesweeper.prototype.sweep = function(field) {
	if(!field || field.length === 0){
		return field;
	}

	if(field.length === 2){
		return ['*','1'];
	}

	field[0] = field[0].replace(/\./g,'0');
	var currentRow,
		column,
		row;

	for(row = 0; row < field.length; row++){
		currentRow = field[row].split('')

		for(column = 0; column < currentRow.length; column++){
			if(currentRow[column] === "*"){
				this.getAdjacentIndices(currentRow, column)
					.filter(function(currentIndex){
						return currentRow[currentIndex] !== '*'
					})
					.forEach(function(currentIndex){
						currentRow[currentIndex] ++;
					});
			}
		}
	}

	return [currentRow.join('')];
};

Minesweeper.prototype.getAdjacentIndices = function(row, index) {
	var adjacentIndices = [];
	if (index+1 < row.length){
		adjacentIndices.push(index + 1);
	}
	if (index-1 >= 0){
		adjacentIndices.push(index - 1);
	}
	return adjacentIndices;
};
@@ -300,26 +300,26 @@
 w++)%7B%0A%09%09
-currentR
+field%5Br
 ow
+%5D
  = field
@@ -333,16 +333,44 @@
 plit('')
+;%0A%09%09currentRow = field%5Brow%5D;
 %0A%0A%09%09for(
@@ -426,26 +426,26 @@
 %7B%0A%09%09%09if(
-currentR
+field%5Br
 ow
+%5D
 %5Bcolumn%5D
@@ -483,24 +483,24 @@
 Indices(
-currentR
+field, r
 ow, colu
@@ -521,36 +521,28 @@
 er(function(
-currentIndex
+pair
 )%7B%0A%09%09%09%09%09%09ret
@@ -545,39 +545,38 @@
 %09return 
-currentRow%5BcurrentIndex
+field%5Bpair%5B0%5D%5D%5Bpair%5B1%5D
 %5D !== '*
@@ -612,52 +612,43 @@
 ion(
-currentIndex)%7B%0A%09%09%09%09%09%09currentRow%5BcurrentIndex
+pair)%7B%0A%09%09%09%09%09%09field%5Bpair%5B0%5D%5D%5Bpair%5B1%5D
 %5D ++
@@ -762,18 +762,26 @@
 ion(
-row, index
+field, row, column
 ) %7B%0A
@@ -816,21 +816,29 @@
 if (
-index+1 %3C 
+column+1 %3C field%5B
 row
+%5D
 .len
@@ -870,17 +870,25 @@
 ush(
-index
+%5Brow, column
  + 1
+%5D
 );%0A%09
@@ -894,21 +894,22 @@
 %09%7D%0A%09if (
-index
+column
 -1 %3E= 0)
@@ -937,17 +937,25 @@
 ush(
-index
+%5Brow, column
  - 1
+%5D
 );%0A%09

address the field by row, column instead of only column