Javascript String findBox(n)

Description

Javascript String findBox(n)

var box = function(board, i){
 console.log(Math.floor((board.length % i)/3) + Math.floor(i/(9*3)))

} 
String.prototype.findBox = function(n){
 var b = box(this, n)
 var values = ""
 for(var x=0; x<81; x++){
  if(box(this, x) == b){
   values += this[x]/* www .j  av  a2s.  co m*/
  }
 }
 return values
}



PreviousNext

Related