<commit_before>//A small but powerful library to solve sudokus

var SelectedIndex=0;
var board=[],alternatives=[],checkGrid=[0,1,2,9,10,11,18,19,20];
var changedStuff=true,time;

//Library-specific variables
var allSolved=[],validSolution=[];
var solveNo,solveCount;


//for backtrack solving
var savedBoards=[],insertAt=[],possibleValues=[],checked=[];
for (var i=0;i<80;i++){savedBoards.push(0); insertAt.push(0); possibleValues.push(0); checked.push(0);}
var level;

var sudoku={
	solve: function(array,no){
	 	solveNo=no;
		if (no<1||no==null||isNaN(no)){solveNo=1;}
		coreSolve(array);
		return {
			solved: (validSolution!=[]),
			solution: validSolution,
			allSolutions: allSolved,
			solutionNo: solveCount,
			time: (new Date().getTime()-time)
		}
	}
};

function setAndReset(){
  solveCount=0;
  allSolved=[];
	validSolution=[];
  
  savedBoards=[];
  insertAt=[];
  possibleValues=[];
  checked=[];
  for (var i=0;i<80;i++){savedBoards.push(0); insertAt.push(0); possibleValues.push(0); checked.push(0);}
}
<commit_msg>Update sudokuSolver.js<commit_after>//A small but powerful library to solve sudokus

var SelectedIndex=0;
var board=[],alternatives=[],checkGrid=[0,1,2,9,10,11,18,19,20];
var changedStuff=true,time;

//Library-specific variables
var allSolved=[],validSolution=[];
var solveNo,solveCount;


//for backtrack solving
var savedBoards=[],insertAt=[],possibleValues=[],checked=[];
for (var i=0;i<80;i++){savedBoards.push(0); insertAt.push(0); possibleValues.push(0); checked.push(0);}
var level;

var sudoku={
	solve: function(array,no){
	 	solveNo=no;
		if (no<1||no==null||isNaN(no)){solveNo=1; alert("WOO");}
		coreSolve(array);
		return {
			solved: (validSolution!=[]),
			solution: validSolution,
			allSolutions: allSolved,
			solutionNo: solveCount,
			time: (new Date().getTime()-time)
		}
	}
};

function setAndReset(){
  solveCount=0;
  allSolved=[];
	validSolution=[];
  
  savedBoards=[];
  insertAt=[];
  possibleValues=[];
  checked=[];
  for (var i=0;i<80;i++){savedBoards.push(0); insertAt.push(0); possibleValues.push(0); checked.push(0);}
}

{'fraction_non_alphanumeric': 0.19376498800959233, 'fraction_numerical': 0.030695443645083934, 'mean_word_length': 6.243055555555555, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7188663', 'n_tokens_mistral': 843, 'n_tokens_neox': 785, 'n_words': 138}