<repo_name>Eforen/HTML5-Sudoku<file_sep>/Gruntfile.js
module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    browserify: {
      all: {
        files: {'public/javascripts/bundle.js': ['src/js/app.js']}
      }
    },
    watch: {
      main: {
        options: {
          livereload: true,
        },
        files: [ "src/js/**/*.js", "src/view/**/*.jsx"],
        tasks: [ 'browserify' ]
      },
      test: {
        options: {
          spawn: false,
        },
        files: [ "src/js/**/*.js", "test/**/*.js"],
        tasks: [ 'clear', 'mochaTest:all', 'jshint:codeBase' ]
      },
      doc: {
        options: {
          spawn: false,
          livereload: true
        },
        files: [ "src/js/**/*.js"],
        tasks: [ 'jsdoc:all' ]
      },
      testndoc: {
        options: {
          spawn: false,
          livereload: 35730
        },
        files: [ "src/js/**/*.js", "test/**/*.js"],
        tasks: [ 'clear', 'mochaTest:all', 'jshint:codeBase', 'jsdoc:all' ]
      }
    },
    exec: {
    	start: "node ./bin/www",
	    test: "node ./node_modules/mocha/bin/_mocha --reporter spec",
	    testnyan: "node ./node_modules/mocha/bin/_mocha --reporter nyan"
    },
    concurrent: {
      develop: ['watch:main', 'exec:start'],
      developTest: ['watch:test', 'exec:start'],
      test: ['jshint', 'mocha']
    },
    copy:{
      html: {
        files: [{
            expand: true,
            cwd: 'src/',
            src: ['*.html'],
            dest: 'public/'
        }]
            }
    },
    jshint: {
      options: { //http://jshint.com/docs/options/
        asi: true, //This option suppresses warnings about missing semicolons.
        boss: false, //This option suppresses warnings about the use of assignments in cases where comparisons are expected. More often than not, code like if (a = 10) {} is a typo. 
        curly: false, //This option requires you to always put curly braces around blocks in loops and conditionals.

        eqeqeq: false, //This options prohibits the use of == and != in favor of === and !==. The former try to coerce values before comparing them which can lead to some unexpected results. The latter don't do any coercion so they are generally safer.
        eqnull: true, //This option suppresses warnings about == null comparisons.
        esnext: true, //This option tells JSHint that your code uses ECMAScript 6 specific syntax.
        browser: true, //This option defines globals exposed by modern browsers

        module: true, //This option informs JSHint that the input code describes an ECMAScript 6 module.


        globals: {
          jQuery: true
        },
      },
      codeBase: {
        files: {
          src: [ "src/js/**/*.js", "!public/javascripts/bundle.js" ]
        }
      },
      bundle:{
        options: {
          undef: true,
        },
        files: {
          src: ['public/javascripts/bundle.js']
        }
      }
    },
    mochaTest: {
      all: {
        options: {
          ui: 'bdd',
          reporter: 'spec',
          captureFile: 'TestResults.txt',
          quiet: false, // Optionally suppress output to standard out (defaults to false) 
          clearRequireCache: true // Clear the require cache before running tests so that the tests actually run on the new code
        },
        src:['test/**/*.js']
      },
      react: {
        options: {
          ui: 'bdd',
          reporter: 'spec',
          captureFile: 'TestResults/react.txt',
          quiet: false, // Optionally suppress output to standard out (defaults to false) 
          clearRequireCache: true, // Clear the require cache before running tests so that the tests actually run on the new code
          require: ["mocha-babel"]
        },
        src:['test/**/*.jsx']
      }
    },
    jsdoc : {
      all : {
        src: ['src/**/*.js'],
        jsdoc: 'node_modules/.bin/jsdoc',
        options: {
          destination: 'docs',
          private: true,
          verbose: true,
          template : "docs-template",
          readme: "README.md",
          package: "package.json"
          //configure : "jsdoc.conf.json"
        }
      }
    },
    babel: {
      options: {
          sourceMap: true,
          modules: "common"
      },
      dist: {
          src: ['src/view/*.jsx'],
          dest: 'tmp/view.js'
      }
    },
    sass: {                              // Task
      dist: {                            // Target
        options: {                       // Target options
          style: 'expanded'
        },
        files: {                         // Dictionary of files
          'public/stylesheets/main.css': 'src/styles/main.scss'//,       // 'destination': 'source'
          //'widgets.css': 'widgets.scss'
        }
      }
    }
  })

  grunt.loadNpmTasks('grunt-browserify')
  grunt.loadNpmTasks('grunt-babel')
  grunt.loadNpmTasks('grunt-clear')
  grunt.loadNpmTasks('grunt-concurrent')
  grunt.loadNpmTasks('grunt-contrib-copy')
  grunt.loadNpmTasks('grunt-contrib-jshint')
  grunt.loadNpmTasks('grunt-contrib-watch')
  grunt.loadNpmTasks('grunt-exec')
  grunt.loadNpmTasks('grunt-mocha-test')
  grunt.loadNpmTasks('grunt-jsdoc')
  grunt.loadNpmTasks('grunt-contrib-sass')

  grunt.registerTask('build', ['clear', 'sass:dist', 'copy:html', 'browserify:all']);
  grunt.registerTask('default', ['jshint:codeBase', 'mochaTest:all', 'browserify', 'uglify', 'jshint:bundle']);
  grunt.registerTask('develop', ['browserify', 'concurrent:develop']);
  grunt.registerTask('developTest', ['browserify', 'concurrent:developTest']);
  grunt.registerTask('buildDocs', ['jsdoc']);
  grunt.registerTask('watchDoc', ['watch:doc']);
  
  //grunt.registerTask('test', ['watch:test']);
  grunt.registerTask('test', 'runs my tasks', function () {
      var tasks = ['mochaTest:all', 'jshint:codeBase', 'watch:test'];

      // Use the force option for all tasks declared in the previous line
      // This allows tests to fail and still run jshint after
      grunt.option('force', true);

      grunt.task.run(tasks);
  });

  grunt.registerTask('testndoc', 'runs my tasks', function () {
      var tasks = ['mochaTest:all', 'jshint:codeBase', 'watch:testndoc'];

      // Use the force option for all tasks declared in the previous line
      // This allows tests to fail and still run jshint after
      grunt.option('force', true);

      grunt.task.run(tasks);
  });


  var defaultTestSrc = grunt.config('mochaTest.all.src');

  var defaultJsHintSrc = grunt.config('jshint.codeBase.files.src');
  // on watch:test events configure mochaTest.all to only run on changed file
  grunt.event.on('watch', function(action, filepath, target) {
    console.log("wtf!")
    if(target == "test" || target == "testndoc"){
      //debug
      console.log("Test: "+ target + " | "+ action + " | " + filepath)

      //Set Syntax Check
      grunt.config('jshint.codeBase.files.src', filepath)

      //change reporter to nyan for compressed output
      //grunt.config('mochaTest.all.options.reporter', 'nyan')

      //make my own filepath storage
      var file = filepath;

      //if the path is not already a test then target the correct test
      if(file.indexOf('src\\js\\') === 0) {
        //change file target
        file = "test\\test."+file.substring(7);
        console.log("Test: "+file+"|"+ file.substring(7)); //debug

      }

      if(grunt.file.exists(file)){
        console.log("Targeted test found running...");
        //put file path in array for mochaTest
        //file = [file];

        //Set test target
        grunt.config('mochaTest.all.src', file);
      } else{
        grunt.fail.warn('File ' + file + ' doesn\'t exist.');
        //run the all the tests if file not found
        console.log("Targeted test not found running all...");
        grunt.config('mochaTest.all.src', defaultTestSrc);
      }
    }
  });
}<file_sep>/test/test.tileStore.js
var expect = require("chai").expect;
var tileStore = require("../src/js/tileStore.js");
var sudoku = require("../src/js/sudokuOBJ.js");

describe("tileStore Object", function() {
	it("should have all available", function(done){
		var store = new tileStore();
		expect(store.available()).to.deep.equal([true,true,true,true,true,true,true,true,true]);
		done();
	})

	it("should have no tiles at construction", function(done){
		var store = new tileStore();
		expect(store.tiles).to.have.length(0);
		done();
	})
})<file_sep>/src/js/app.js
/**
 * @file Main App Code
 * @author <NAME>
 */

window.sudokuOBJ = require("./sudokuOBJ.js");
window.sudokuSolver = require("./sudokuSolver.js");
window.token = require("./tokenENUM.js");

//test = new window.sudokuOBJ();
window.testData = {
			name: "Simple Test",	
			puzzle: "043000620700403008600208007075000340000000000098000570900507003100602005087000260"
		}

window.su = window.sudokuOBJ.loadFromOBJ(window.testData);
window.solve = new window.sudokuSolver(window.su);
window.su2 = window.solve.getSudoku();
/*
*/


window.runTest = function(){
	solve.solvePassBasic()
	solve.solvePassBasic()
	solve.solvePassBasic()
	solve.solvePassBasic()
	solve.solveRegionExclusion()
	solve.solvePassBasic()
	solve.solveRowExclusion()
	solve.solvePassBasic()
	solve.solveColExclusion()
	solve.solvePassBasic()
	solve.solveRegionExclusion()
	solve.solvePassBasic()
	solve.solveRowExclusion()
	solve.solvePassBasic()
	solve.solvePassBasic()
}

window.runRenderWait = function(waitTime, index){
	if(waitTime == null || waitTime <= 0) return
	if(index == null || index < 0) index = 0;

	switch (index) {
		case 0:
			window.solve.solvePassBasic()
			break
		case 1:
			window.solve.solvePassBasic()
			break
		case 2:
			window.solve.solvePassBasic()
			break
		case 3:
			window.solve.solvePassBasic()
			break
		case 4:
			window.solve.solveRegionExclusion()
			break
		case 5:
			window.solve.solvePassBasic()
			break
		case 6:
			window.solve.solveRowExclusion()
			break
		case 7:
			window.solve.solvePassBasic()
			break
		case 8:
			window.solve.solveColExclusion()
			break
		case 9:
			window.solve.solvePassBasic()
			break
		case 10:
			window.solve.solveRegionExclusion()
			break
		case 11:
			window.solve.solvePassBasic()
			break
		case 12:
			window.solve.solveRowExclusion()
			break
		case 13:
			window.solve.solvePassBasic()
			break
		case 14:
			window.solve.solvePassBasic()
			break
		default:
			return
	}

	index++
	setTimeout(window.runRenderWait, waitTime, waitTime, index)
	window.renderView();
}

require("../view/view.jsx")
//require("./view.js")<file_sep>/test/test.tileOBJ.js
var expect = require("chai").expect;

var sudoku = require("../src/js/sudokuOBJ.js");
var tileStore = require("../src/js/tileStore.js");
var tileOBJ = require("../src/js/tileOBJ.js");

var tokens = require("../src/js/tokenENUM.js");
var debug = require("../src/js/debugger.js");

describe("tile Object", function() {

	//var su = null;
	var tile = null;

	beforeEach(function(done) {
		//su = new sudoku(); //should not need this
		//su = null; //Debug setup expectation
		//expect(su).not.to.be.null; //Test setup expectation

		tile = new tileOBJ();
		expect(tile).not.to.be.null;
		done();
	})

	it("should instansiate available", function(done){
		expect(tile).not.to.be.null;
		expect(tile).to.be.instanceof(tileOBJ);
		done();
	})

	describe("setup", function() {
		var su = null;
		beforeEach(function(done){
			su = new sudoku(); //should not need this
			expect(su).not.to.be.null; //Test setup expectation

			expect(tile.setup).to.be.a('function');
			tile.setup(su.getRow(1), su.getCol(2), su.getRegion(1), 3,2);

			done();
		})

		it("before setup isSetup should be false", function(done){
			var t = new tileOBJ();
			expect(t.isSetup).to.be.false;
			done();
		})

		it("after setup isSetup should be true", function(done){
			expect(tile.isSetup).to.be.true;
			done();
		})

		it("rows match", function(done){
			expect(tile.getRow()).to.equal(su.getRow(1));
			done();
		})
		it("cols match", function(done){
			expect(tile.getCol()).to.equal(su.getCol(2));
			done();
		})
		it("region match", function(done){
			expect(tile.getRegion()).to.equal(su.getRegion(1));
			done();
		})
		it("pos x match", function(done){
			expect(tile.getX()).to.equal(3);
			done();
		})
		it("pos y match", function(done){
			expect(tile.getY()).to.equal(2);
			done();
		})

	})

	describe("data Values", function() {
		var su = null;
		beforeEach(function(done){
			done();
		})

		it("default Token", function(done){
			expect(tile.getToken()).to.equal(1);
			done();
		})	

		it("default Type", function(done){
			expect(tile.getType()).to.equal(tileOBJ.types.blank);
			done();
		})		

		it("set Token", function(done){
			tile.setToken(tokens.c);
			done();
		})

		it("set Type", function(done){
			tile.setType(tileOBJ.types.guess);
			done();
		})

		it("set Both", function(done){
			tile.set(tokens.c, tileOBJ.types.guess);
			done();
		})

		it("get token Token", function(done){
			tile.setToken(tokens.c);
			expect(tile.getToken()).to.equal(tokens.c);
			done();
		})

		it("get type Type", function(done){
			tile.setType(tileOBJ.types.guess);
			expect(tile.getType()).to.equal(tileOBJ.types.guess);
			done();
		})

		it("get both", function(done){
			tile.set(tokens.c, tileOBJ.types.guess);
			expect(tile.get().token).to.equal(tokens.c);
			expect(tile.get().type).to.equal(tileOBJ.types.guess);
			done();
		})

	})

	describe("Guessing", function(){
		it("guess default should be false", function(done){
			expect(tile.getGuess(tokens.b)).to.equal(false);
			done();
		})
		it("can set guess (value)", function(done){
			expect(tile.getGuess(tokens.c)).to.equal(false);
			tile.setGuess(tokens.c);
			expect(tile.getGuess(tokens.c)).to.equal(true);
			done();
		})
		
		it("can set guess (type)", function(done){
			expect(tile.getType()).to.equal(tileOBJ.types.blank);
			tile.setGuess(tokens.d);
			expect(tile.getType()).to.equal(tileOBJ.types.guess);
			done();
		})

		it("can get guesses as array", function(done){
			expect(tile.getGuesses()).to.be.instanceof(Array);
			done();
		})
		
		it("can set guesses as array partial range", function(done){
			expect(tile.getGuess(tokens.a)).to.equal(false);
			expect(tile.getGuess(tokens.b)).to.equal(false);
			expect(tile.getGuess(tokens.c)).to.equal(false);
			expect(tile.getGuess(tokens.d)).to.equal(false);
			expect(tile.getGuess(tokens.e)).to.equal(false);
			expect(tile.getGuess(tokens.f)).to.equal(false);

			var arr = []
			arr[tokens.a] = true;
			arr[tokens.b] = false;
			arr[tokens.c] = true;
			arr[tokens.d] = true;
			arr[tokens.f] = true;

			tile.setGuesses(arr);

			expect(tile.getGuess(tokens.a)).to.equal(true);
			expect(tile.getGuess(tokens.b)).to.equal(false);
			expect(tile.getGuess(tokens.c)).to.equal(true);
			expect(tile.getGuess(tokens.d)).to.equal(true);
			expect(tile.getGuess(tokens.e)).to.equal(false);
			expect(tile.getGuess(tokens.f)).to.equal(true);
			done();
		})
		
		it("can set guesses as array full range", function(done){
			expect(tile.getGuess(tokens.a)).to.equal(false);
			expect(tile.getGuess(tokens.b)).to.equal(false);
			expect(tile.getGuess(tokens.c)).to.equal(false);
			expect(tile.getGuess(tokens.d)).to.equal(false);
			expect(tile.getGuess(tokens.e)).to.equal(false);
			expect(tile.getGuess(tokens.f)).to.equal(false);
			expect(tile.getGuess(tokens.g)).to.equal(false);
			expect(tile.getGuess(tokens.h)).to.equal(false);
			expect(tile.getGuess(tokens.i)).to.equal(false);

			var arr = []
			arr[tokens.a] = true;
			arr[tokens.b] = true;
			arr[tokens.c] = true;
			arr[tokens.d] = true;
			arr[tokens.e] = true;
			arr[tokens.f] = true;
			arr[tokens.g] = true;
			arr[tokens.h] = true;
			arr[tokens.i] = true;

			tile.setGuesses(arr);

			expect(tile.getGuess(tokens.a)).to.equal(true);
			expect(tile.getGuess(tokens.b)).to.equal(true);
			expect(tile.getGuess(tokens.c)).to.equal(true);
			expect(tile.getGuess(tokens.d)).to.equal(true);
			expect(tile.getGuess(tokens.e)).to.equal(true);
			expect(tile.getGuess(tokens.f)).to.equal(true);
			expect(tile.getGuess(tokens.g)).to.equal(true);
			expect(tile.getGuess(tokens.h)).to.equal(true);
			expect(tile.getGuess(tokens.i)).to.equal(true);
			done();
		})
		
		it("can set all guesses to value", function(done){
			expect(tile.getGuess(tokens.a)).to.equal(false);
			expect(tile.getGuess(tokens.b)).to.equal(false);
			expect(tile.getGuess(tokens.c)).to.equal(false);
			expect(tile.getGuess(tokens.d)).to.equal(false);
			expect(tile.getGuess(tokens.e)).to.equal(false);
			expect(tile.getGuess(tokens.f)).to.equal(false);
			expect(tile.getGuess(tokens.g)).to.equal(false);
			expect(tile.getGuess(tokens.h)).to.equal(false);
			expect(tile.getGuess(tokens.i)).to.equal(false);

			tile.setGuesses(true);

			expect(tile.getGuess(tokens.a)).to.equal(true);
			expect(tile.getGuess(tokens.b)).to.equal(true);
			expect(tile.getGuess(tokens.c)).to.equal(true);
			expect(tile.getGuess(tokens.d)).to.equal(true);
			expect(tile.getGuess(tokens.e)).to.equal(true);
			expect(tile.getGuess(tokens.f)).to.equal(true);
			expect(tile.getGuess(tokens.g)).to.equal(true);
			expect(tile.getGuess(tokens.h)).to.equal(true);
			expect(tile.getGuess(tokens.i)).to.equal(true);

			tile.setGuesses(false);

			expect(tile.getGuess(tokens.a)).to.equal(false);
			expect(tile.getGuess(tokens.b)).to.equal(false);
			expect(tile.getGuess(tokens.c)).to.equal(false);
			expect(tile.getGuess(tokens.d)).to.equal(false);
			expect(tile.getGuess(tokens.e)).to.equal(false);
			expect(tile.getGuess(tokens.f)).to.equal(false);
			expect(tile.getGuess(tokens.g)).to.equal(false);
			expect(tile.getGuess(tokens.h)).to.equal(false);
			expect(tile.getGuess(tokens.i)).to.equal(false);
			done();
		})
		
		it("should change type to set when was guess", function(done){
			tile.setGuesses(true);
			tile.set(tokens.a);
			expect(tile.getType()).to.equal(tileOBJ.types.set);
			done();
		})
		
		it("should change type to set when was guess 2", function(done){
			tile.setGuesses(true);
			tile.setToken(tokens.a);
			expect(tile.getType()).to.equal(tileOBJ.types.set);
			done();
		})
		
		it("should NOT change type to guess when mass falseing and was set", function(done){
			tile.setGuesses(true);
			tile.setToken(tokens.a);
			tile.setType(tileOBJ.types.guess);
			//Object.watch("tile._type", function(){ console.log(debug.getstack())})
			var arr = []
			arr[tokens.a] = false;
			arr[tokens.d] = false;
			arr[tokens.i] = false;
			tile.setGuesses(arr)
			expect(tile.getType()).to.equal(tileOBJ.types.guess);

			tile.setGuesses(true);
			tile.setToken(tokens.a);
			tile.setType(tileOBJ.types.set);
			//Object.watch("tile._type", function(){ console.log(debug.getstack())})
			var arr = []
			arr[tokens.a] = false;
			arr[tokens.d] = false;
			arr[tokens.i] = false;
			tile.setGuesses(arr)
			expect(tile.getType()).to.equal(tileOBJ.types.set);

			tile.setGuesses(true);
			tile.setToken(tokens.a);
			tile.setType(tileOBJ.types.lock);
			//Object.watch("tile._type", function(){ console.log(debug.getstack())})
			var arr = []
			arr[tokens.a] = false;
			arr[tokens.d] = false;
			arr[tokens.i] = false;
			tile.setGuesses(arr)
			expect(tile.getType()).to.equal(tileOBJ.types.lock);

			done();
		})
	})
})<file_sep>/src/view/sudokuTile.jsx
var React   = require('react');

var tileOBJ   = require("../js/tileOBJ.js");

/**
 * This makes the sudoku tile dom
 * @name SudokuTile
 * @module
 */
var SudokuTile = React.createClass({
  render: function() {
  	var id = null
  	if(this.props.x != null & this.props.y != null){
  		id = this.props.x+"x"+this.props.y
  	}

  	var style = {

  	}

  	var inside = null
  	switch (this.props.tile.getType()){
  		case tileOBJ.types.set:
  			inside = (<div className="set">{this.props.tile._value}</div>)
  			break
  		case tileOBJ.types.locked:
  			inside = (<div className="locked">{this.props.tile._value}</div>)
  			break
  		case tileOBJ.types.guess:
  			var guessItems = []
  			var guesses = this.props.tile._guesses;

  			for (var i = 0; i < guesses.length; i++) {
  				if(guesses[i] === true){
					//console.log("guesses["+i+"]="+guesses[i])
  					guessItems.push(<span key={i} className={"guess guess-"+i}>{i}</span>)
  				}
  			}
  			inside = (<div className="guesses">{guessItems}</div>)
  			break
  		default:
  			inside = (<div className="empty"> </div>)
  	}
    return (<div style={style} className={(this.props.x != null & this.props.y != null)?"tile tile-"+id:"tile"}> {inside} </div>)
  }
});

module.exports = SudokuTile<file_sep>/src/js/tokenENUM.js
/**
 * @file tokenENUM Code
 * @author <NAME>
 */

/**
 * Enum of Token Values
 * @readonly
 * @enum {number}
 */

/*
var tokenENUM = {
	a: 1,
	b: 2,
	c: 3,

	d: 4,
	e: 5,
	f: 6,

	g: 7,
	h: 8,
	i: 9
}
exports = tokenENUM
*/

exports.a = 1;
exports.b = 2;
exports.c = 3;

exports.d = 4;
exports.e = 5;
exports.f = 6;

exports.g = 7;
exports.h = 8;
exports.i = 9;<file_sep>/test/test.sudokuSolver.js
var expect = require("chai").expect;
var sudokuSolver = require("../src/js/sudokuSolver.js");
var sudokuOBJ = require("../src/js/sudokuOBJ.js");
var tileStore = require("../src/js/tileStore.js");
var tileOBJ = require("../src/js/tileOBJ.js");

var tokens = require("../src/js/tokenENUM.js");

describe("sudoku solver", function() {

	var su = null;
	var solve = null;

	beforeEach(function(done) {
		var test = {
			name: "<NAME>",	
			puzzle: "043000620700403008600208007075000340000000000098000570900507003100602005087000260"
		}

		su = sudokuOBJ.loadFromOBJ(test);
		//su = null; //Debug setup expectation
		expect(su).not.to.be.null; //Test setup expectation
		expect(su).to.be.instanceof(sudokuOBJ); //Test setup expectation

		solve = new sudokuSolver(su);
		expect(solve).not.to.be.null; //Test setup expectation
		expect(solve).to.be.instanceof(sudokuSolver); //Test setup expectation

		done();
	})

	it("should instansiate and be available", function(done){
		expect(solve).not.to.be.null;
		expect(solve).to.be.instanceof(sudokuSolver); //Test setup expectation
		done();
	})

	it("it should contain the sudoku provided before", function(done){
		solve.getSudoku().getTile(1,1).setType(tileOBJ.types.locked)
		expect(solve.getSudoku()).to.be.equal(su);
		expect(su.getTile(1,1).getType()).to.be.equal(tileOBJ.types.locked);
		done();
	})

	it("should prep object sudoku by filling every tile with all guesses", function(done){
		var tile;


		expect(su.debugRow(0)).to.equal("|123456789|4|3|123456789|123456789|123456789|6|2|123456789|")
		expect(su.debugRow(1)).to.equal("|7|123456789|123456789|4|123456789|3|123456789|123456789|8|")
		expect(su.debugRow(2)).to.equal("|6|123456789|123456789|2|123456789|8|123456789|123456789|7|")
		expect(su.debugRow(3)).to.equal("|123456789|7|5|123456789|123456789|123456789|3|4|123456789|")
		expect(su.debugRow(4)).to.equal("|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		expect(su.debugRow(5)).to.equal("|123456789|9|8|123456789|123456789|123456789|5|7|123456789|")
		expect(su.debugRow(6)).to.equal("|9|123456789|123456789|5|123456789|7|123456789|123456789|3|")
		expect(su.debugRow(7)).to.equal("|1|123456789|123456789|6|123456789|2|123456789|123456789|5|")
		expect(su.debugRow(8)).to.equal("|123456789|8|7|123456789|123456789|123456789|2|6|123456789|")
		
		expect(solve.getSudoku().getTile(0,0).getType()).to.equal(tileOBJ.types.guess)

		var val = true;
		for (var x = 0; x < 9; x++) {
			for (var y = 0; y < 9; y++) {
				tile = solve.getSudoku().getTile(x,y);
				//tile = su.getTile(x,y);
				val = true;

				expect(tile.getType()).to.not.equal(tileOBJ.types.blank)

				if(tile.getType() == tileOBJ.types.locked) val = false;

				expect(tile.getGuess(tokens.a)).to.equal(val);
				expect(tile.getGuess(tokens.b)).to.equal(val);
				expect(tile.getGuess(tokens.c)).to.equal(val);
				expect(tile.getGuess(tokens.d)).to.equal(val);
				expect(tile.getGuess(tokens.e)).to.equal(val);
				expect(tile.getGuess(tokens.f)).to.equal(val);
				expect(tile.getGuess(tokens.g)).to.equal(val);
				expect(tile.getGuess(tokens.h)).to.equal(val);
				expect(tile.getGuess(tokens.i)).to.equal(val);
			}
		}
		done();
	})

	// 0dc 000 fb0
	// g00 d0c 00h
	// f00 b0h 00g

	// 0ge 000 cd0
	// 000 000 000
	// 0ih 000 eg0

	// i00 e0g 00c
	// a00 f0b 00e
	// 0hg 000 bf0

	it("should remove all guesses of tile that are in row", function(done){
		//Confirming Start state
		expect(su.debugRow(0)).to.equal("|123456789|4|3|123456789|123456789|123456789|6|2|123456789|")
		//expect(su.debugRow(1)).to.equal("|7|123456789|123456789|4|123456789|3|123456789|123456789|8|")
		expect(solve.getSudoku().getTile(0,0).getType()).to.equal(tileOBJ.types.guess)

		solve.solveForRow(0);
		solve.solveForRow(1);
		solve.solveForRow(2);
		solve.solveForRow(3);
		solve.solveForRow(4);
		solve.solveForRow(5);
		solve.solveForRow(6);
		solve.solveForRow(7);
		solve.solveForRow(8);

		expect(solve.getSudoku().getTile(0,0).getType()).to.equal(tileOBJ.types.guess)

		tile = solve.getSudoku().getTile(0,0);
		expect(tile.getGuess(tokens.a)).to.equal(true); // 1
		expect(tile.getGuess(tokens.b)).to.equal(false); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(true); // 5
		expect(tile.getGuess(tokens.f)).to.equal(false); // 6
		expect(tile.getGuess(tokens.g)).to.equal(true); // 7
		expect(tile.getGuess(tokens.h)).to.equal(true); // 8
		expect(tile.getGuess(tokens.i)).to.equal(true); // 9

		expect(solve.getSudoku().debugRow(0)).to.equal("|15789|4|3|15789|15789|15789|6|2|15789|")
		expect(su.debugRow(1)).to.equal("|7|12569|12569|4|12569|3|12569|12569|8|")
		expect(su.debugRow(2)).to.equal("|6|13459|13459|2|13459|8|13459|13459|7|")
		expect(su.debugRow(3)).to.equal("|12689|7|5|12689|12689|12689|3|4|12689|")
		expect(su.debugRow(4)).to.equal("|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		expect(su.debugRow(5)).to.equal("|12346|9|8|12346|12346|12346|5|7|12346|")
		expect(su.debugRow(6)).to.equal("|9|12468|12468|5|12468|7|12468|12468|3|")
		expect(su.debugRow(7)).to.equal("|1|34789|34789|6|34789|2|34789|34789|5|")
		expect(su.debugRow(8)).to.equal("|13459|8|7|13459|13459|13459|2|6|13459|")
		done()
	})

	it("should remove all guesses of tile that are in col", function(done){
		//check start start state
		expect(su.debugRow(0)).to.equal("|123456789|4|3|123456789|123456789|123456789|6|2|123456789|")
		//expect(su.debugRow(1)).to.equal("|7|123456789|123456789|4|123456789|3|123456789|123456789|8|")
		//expect(su.debugRow(2)).to.equal("|6|123456789|123456789|2|123456789|8|123456789|123456789|7|")
		//expect(su.debugRow(3)).to.equal("|123456789|7|5|123456789|123456789|123456789|3|4|123456789|")
		//expect(su.debugRow(4)).to.equal("|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		//expect(su.debugRow(5)).to.equal("|123456789|9|8|123456789|123456789|123456789|5|7|123456789|")
		//expect(su.debugRow(6)).to.equal("|9|123456789|123456789|5|123456789|7|123456789|123456789|3|")
		//expect(su.debugRow(7)).to.equal("|1|123456789|123456789|6|123456789|2|123456789|123456789|5|")
		//expect(su.debugRow(8)).to.equal("|123456789|8|7|123456789|123456789|123456789|2|6|123456789|")

		solve.solveForCol(0);
		//solve.solveForCol(1);
		//solve.solveForCol(2);
		//solve.solveForCol(3);
		//solve.solveForCol(4);
		//solve.solveForCol(5);
		//solve.solveForCol(6);
		//solve.solveForCol(7);
		//solve.solveForCol(8);

		tile = solve.getSudoku().getTile(0,0);
		//expect(tile.getGuess(tokens.a)).to.equal(false); // 1
		//expect(tile.getGuess(tokens.b)).to.equal(true); // 2
		//expect(tile.getGuess(tokens.c)).to.equal(true); // 3
		//expect(tile.getGuess(tokens.d)).to.equal(true); // 4
		//expect(tile.getGuess(tokens.e)).to.equal(true); // 5
		//expect(tile.getGuess(tokens.f)).to.equal(false); // 6
		//expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		//expect(tile.getGuess(tokens.h)).to.equal(true); // 8
		//expect(tile.getGuess(tokens.i)).to.equal(false); // 9

		expect()
		expect(su.debugCol(0)).to.equal("|23458|7|6|23458|23458|23458|9|1|23458|")
		//expect(su.debugRow(0)).to.equal("|23458|4|3|123456789|123456789|123456789|6|2|123456789|")
		//expect(su.debugRow(1)).to.equal("|7|123456789|123456789|4|123456789|3|123456789|123456789|8|")
		//expect(su.debugRow(2)).to.equal("|6|123456789|123456789|2|123456789|8|123456789|123456789|7|")
		//expect(su.debugRow(3)).to.equal("|23458|7|5|123456789|123456789|123456789|3|4|123456789|")
		//expect(su.debugRow(4)).to.equal("|23458|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		//expect(su.debugRow(5)).to.equal("|23458|9|8|123456789|123456789|123456789|5|7|123456789|")
		//expect(su.debugRow(6)).to.equal("|9|123456789|123456789|5|123456789|7|123456789|123456789|3|")
		//expect(su.debugRow(7)).to.equal("|1|123456789|123456789|6|123456789|2|123456789|123456789|5|")
		//expect(su.debugRow(8)).to.equal("|23458|8|7|123456789|123456789|123456789|2|6|123456789|")
		done()
	})

	// 0 d c
	// g 0 0
	// f 0 0
	it("should remove all guesses of tile that are in region", function(done){
		solve.solveForRegion(0);
		solve.solveForRegion(1);
		solve.solveForRegion(2);
		solve.solveForRegion(3);
		solve.solveForRegion(4);
		solve.solveForRegion(5);
		solve.solveForRegion(6);
		solve.solveForRegion(7);
		solve.solveForRegion(8);

		tile = solve.getSudoku().getTile(0,0);
		expect(tile.getGuess(tokens.a)).to.equal(true); // 1
		expect(tile.getGuess(tokens.b)).to.equal(true); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(true); // 5
		expect(tile.getGuess(tokens.f)).to.equal(false); // 6
		expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		expect(tile.getGuess(tokens.h)).to.equal(true); // 8
		expect(tile.getGuess(tokens.i)).to.equal(true); // 9

		expect(su.debugRegion(0)).to.equal("|12589|4|3|7|12589|12589|6|12589|12589|")
		expect(su.debugRegion(1)).to.equal("|15679|15679|15679|4|15679|3|2|15679|8|")
		expect(su.debugRegion(2)).to.equal("|6|2|13459|13459|13459|8|13459|13459|7|")
		expect(su.debugRegion(3)).to.equal("|12346|7|5|12346|12346|12346|12346|9|8|")
		expect(su.debugRegion(4)).to.equal("|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		expect(su.debugRegion(5)).to.equal("|3|4|12689|12689|12689|12689|5|7|12689|")
		expect(su.debugRegion(6)).to.equal("|9|23456|23456|1|23456|23456|23456|8|7|")
		expect(su.debugRegion(7)).to.equal("|5|13489|7|6|13489|2|13489|13489|13489|")
		expect(su.debugRegion(8)).to.equal("|14789|14789|3|14789|14789|5|2|6|14789|")

		//expect(su.debugRow(0)).to.equal("|123456789|4|3|123456789|123456789|123456789|6|2|123456789|")
		//expect(su.debugRow(1)).to.equal("|7|123456789|123456789|4|123456789|3|123456789|123456789|8|")
		//expect(su.debugRow(2)).to.equal("|6|123456789|123456789|2|123456789|8|123456789|123456789|7|")
		//expect(su.debugRow(3)).to.equal("|123456789|7|5|123456789|123456789|123456789|3|4|123456789|")
		//expect(su.debugRow(4)).to.equal("|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789|")
		//expect(su.debugRow(5)).to.equal("|123456789|9|8|123456789|123456789|123456789|5|7|123456789|")
		//expect(su.debugRow(6)).to.equal("|9|123456789|123456789|5|123456789|7|123456789|123456789|3|")
		//expect(su.debugRow(7)).to.equal("|1|123456789|123456789|6|123456789|2|123456789|123456789|5|")
		//expect(su.debugRow(8)).to.equal("|123456789|8|7|123456789|123456789|123456789|2|6|123456789|")

		done()
	})

	it("pass #01 basic solve", function(done){
		/* Checks each guess agenst every other tile
		   that is SET or LOCKED in the
		   posibility space (ROW, COL or REGION) */

		/* Blank Starter Test
		expect(su.debugRow(0)).to.equal("||4|3||||6|2||")
		expect(su.debugRow(1)).to.equal("|7|||4||3|||8|")
		expect(su.debugRow(2)).to.equal("|6|||2||8|||7|")
		expect(su.debugRow(3)).to.equal("||7|5||||3|4||")
		expect(su.debugRow(4)).to.equal("||||||||||")
		expect(su.debugRow(5)).to.equal("||9|8||||5|7||")
		expect(su.debugRow(6)).to.equal("|9|||5||7|||3|")
		expect(su.debugRow(7)).to.equal("|1|||6||2|||5|")
		expect(su.debugRow(8)).to.equal("||8|7||||2|6||")
		*/

		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|58|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|1569|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|149|1359|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|12689|169|3|4|1269|")
		expect(su.debugRow(4)).to.equal("|234|1236|1246|13789|123456789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|234|9|8|13|12346|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|246|5|148|7|148|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|3489|2|4789|89|5|")
		expect(su.debugRow(8)).to.equal("|345|8|7|139|1349|149|2|6|149|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|043|000|620|\n"+
											"|700|403|008|\n"+
											"|600|208|007|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|005|\n"+
											"|087|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #02 basic solve", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		expect(su.debugRow(0)).to.equal("|58|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|1569|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|149|1359|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|1689|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|123456789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|12346|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|148|7|148|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|789|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")
/*

		expect(su.debugRow(0)).to.equal("|58|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|1569|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|149|1359|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|12689|169|3|4|1269|")
		expect(su.debugRow(4)).to.equal("|234|1236|1246|13789|123456789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|234|9|8|13|12346|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|246|5|148|7|148|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|2489|2|4789|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")
*/
		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|043|000|620|\n"+
											"|700|403|008|\n"+
											"|600|208|007|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|005|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #03 basic solve", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|1569|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|149|1359|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|1689|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|123456789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|12346|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|148|7|148|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|789|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")
		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|403|008|\n"+
											"|600|208|007|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|005|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})
	it("pass #04 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|403|008|\n"+
											"|600|208|007|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|005|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #05 Region Exclusion", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();

		// *********************************************
		// Checks each tiles guesses agenst all other
		// tiles GUESSES in the same posibility REGION and sets it if there
		// are no other tiles with that guess in them in
		// the same region
		// *********************************************


		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|6|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|1689|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|123456789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|12346|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|148|7|148|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|008|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|705|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #06 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|6|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|12345789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|1234|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|148|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|008|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|507|003|\n"+
											"|134|602|705|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #07 Row Exclusion", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();

		// *********************************************
		// Checks each tiles guesses agenst all other
		// tiles GUESSES in the same posibility ROW and sets it if there
		// are no other tiles with that guess in them in
		// the same region
		// *********************************************

		/*
		row = solve.getSudoku().getRow(6)
		tile = row.tiles[0];
		expect(tile.getToken()).to.equal(tokens.i);
		expect(tile.getType()).to.equal(tileOBJ.types.locked);

		tile = row.tiles[1];
		expect(tile.getGuess(tokens.a)).to.equal(false); // 1
		expect(tile.getGuess(tokens.b)).to.equal(true); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(false); // 5
		expect(tile.getGuess(tokens.f)).to.equal(true); // 6
		expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		expect(tile.getGuess(tokens.h)).to.equal(false); // 8
		expect(tile.getGuess(tokens.i)).to.equal(false); // 9
		
		tile = row.tiles[2];
		expect(tile.getGuess(tokens.a)).to.equal(false); // 1
		expect(tile.getGuess(tokens.b)).to.equal(true); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(false); // 5
		expect(tile.getGuess(tokens.f)).to.equal(true); // 6
		expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		expect(tile.getGuess(tokens.h)).to.equal(false); // 8
		expect(tile.getGuess(tokens.i)).to.equal(false); // 9

		tile = row.tiles[3];
		expect(tile.getToken()).to.equal(tokens.e);
		expect(tile.getType()).to.equal(tileOBJ.types.locked);
		
		tile = row.tiles[4];
		expect(tile.getToken()).to.equal(tokens.d);
		expect(tile.getType()).to.equal(tileOBJ.types.set);

		tile = row.tiles[5];
		expect(tile.getToken()).to.equal(tokens.g);
		expect(tile.getType()).to.equal(tileOBJ.types.locked);
		
		tile = row.tiles[6];
		expect(tile.getGuess(tokens.a)).to.equal(true); // 1
		expect(tile.getGuess(tokens.b)).to.equal(false); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(false); // 5
		expect(tile.getGuess(tokens.f)).to.equal(false); // 6
		expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		expect(tile.getGuess(tokens.h)).to.equal(true); // 8
		expect(tile.getGuess(tokens.i)).to.equal(false); // 9

		tile = row.tiles[7];
		expect(tile.getGuess(tokens.a)).to.equal(true); // 1
		expect(tile.getGuess(tokens.b)).to.equal(false); // 2
		expect(tile.getGuess(tokens.c)).to.equal(false); // 3
		expect(tile.getGuess(tokens.d)).to.equal(false); // 4
		expect(tile.getGuess(tokens.e)).to.equal(false); // 5
		expect(tile.getGuess(tokens.f)).to.equal(false); // 6
		expect(tile.getGuess(tokens.g)).to.equal(false); // 7
		expect(tile.getGuess(tokens.h)).to.equal(true); // 8
		expect(tile.getGuess(tokens.i)).to.equal(false); // 9

		tile = row.tiles[8];
		expect(tile.getToken()).to.equal(tokens.c);
		expect(tile.getType()).to.equal(tileOBJ.types.locked);
		*/

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|6|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|12345789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|1234|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|1349|149|2|6|149|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|008|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|602|705|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #08 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|6|3|19|159|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|1235789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|149|")


		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|008|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|602|705|\n"+
											"|587|000|260|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #09 Col Exclusion", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();

		// *********************************************
		// Checks each tiles guesses agenst all other
		// tiles GUESSES in the same posibility COL and sets it if there
		// are no other tiles with that guess in them in
		// the same region
		// *********************************************

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|125|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|1235789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")


		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|602|705|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})


    /* Don't need to run these most of the time
	it("pass #10 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|15|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|1235789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|89|2|7|89|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|600|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|602|705|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})

//////////

	it("pass #11 region Exclusion", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|159|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|189|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|1235789|14569|189|189|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #12 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|189|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|123579|14569|189|18|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|000|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #13 row Exclusion", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|13789|123579|14569|189|18|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		
		done()
	})

	it("pass #14 Basic Pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|1379|123579|14569|189|18|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #15 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|1379|123579|14569|189|18|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");

		done()
	})

	it("pass #16 simple is stuck", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic(); //No change start simple
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic(); //first run finished trying again
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion(); //No Change
		solve.solvePassBasic(); //No change running simple one more time
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();

		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|1379|123579|14569|189|18|1269|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");

		done()
	})

	it("pass #17.a run pairs pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairsRow()


		expect(su.debugRow(0)).to.equal("|8|4|3|179|1579|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")

		expect(su.debugRow(4)).to.equal("|34|16|16|379|23579|459|89|8|29|")

		expect(su.debugRow(5)).to.equal("|34|9|8|13|123|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|139|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");

		done()
	})

	it("pass #17.b run pairs pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairsRow();

		solve.checkPairsCol();



		expect(su.debugCol(0)).to.equal("|8|7|6|2|34|34|9|1|5|")
		expect(su.debugCol(1)).to.equal("|4|12|5|7|16|9|26|3|8|")
		expect(su.debugCol(2)).to.equal("|3|129|19|5|16|8|26|4|7|")
		expect(su.debugCol(3)).to.equal("|179|4|2|8|379|13|5|6|139|")
		expect(su.debugCol(4)).to.equal("|57|6|19|19|2357|23|4|8|3|")
		expect(su.debugCol(5)).to.equal("|159|3|8|169|459|146|7|2|19|")
		expect(su.debugCol(6)).to.equal("|6|19|4|3|89|5|18|7|2|")
		expect(su.debugCol(7)).to.equal("|2|5|3|4|8|7|18|9|6|")
		expect(su.debugCol(8)).to.equal("|19|8|7|169|29|126|3|5|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");

		done()
	})

	it("pass #17.c run pairs pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairsRow()
		solve.checkPairsCol()

		solve.checkPairsRegion()

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");
		done()
	})
    */

	it("pass #17 run pairs pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs()


		expect(su.debugRow(0)).to.equal("|8|4|3|179|57|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|379|2357|459|89|8|29|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|23|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|139|3|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|620|\n"+
											"|700|463|058|\n"+
											"|650|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|000|000|000|\n"+
											"|098|000|570|\n"+
											"*---+---+---*\n"+
											"|900|547|003|\n"+
											"|134|682|795|\n"+
											"|587|000|264|\n"+
											"*---*---*---*\n");

		done()
	})

    /* Don't need to run these most of the time
	it("pass #18 Basic Pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();


		 expect(su.debugRow(0)).to.equal("|8|4|3|179|57|159|6|2|19|")
		 expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		 expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		 expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		 expect(su.debugRow(4)).to.equal("|34|16|16|379|2357|459|89|8|29|")
		 expect(su.debugRow(5)).to.equal("|34|9|8|13|23|146|5|7|126|")
		 expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|18|3|")
		 expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		 expect(su.debugRow(8)).to.equal("|5|8|7|139|3|19|2|6|4|")

		 expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											 "|843|000|620|\n"+
											 "|700|463|058|\n"+
											 "|650|208|437|\n"+
											 "*---+---+---*\n"+
											 "|275|800|340|\n"+
											 "|000|000|080|\n"+
											 "|098|000|570|\n"+
											 "*---+---+---*\n"+
											 "|900|547|003|\n"+
											 "|134|682|795|\n"+
											 "|587|030|264|\n"+
											 "*---*---*---*\n");

		done()
	})

	it("pass #19 Basic Pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();


		expect(su.debugRow(0)).to.equal("|8|4|3|179|57|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|19|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|169|")
		expect(su.debugRow(4)).to.equal("|34|16|16|379|257|459|9|8|29|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|2|146|5|7|126|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|18|1|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|19|3|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
			"|843|000|620|\n"+
			"|700|463|058|\n"+
			"|650|208|437|\n"+
			"*---+---+---*\n"+
			"|275|800|340|\n"+
			"|000|000|980|\n"+
			"|098|020|570|\n"+
			"*---+---+---*\n"+
			"|900|547|013|\n"+
			"|134|682|795|\n"+
			"|587|030|264|\n"+
			"*---*---*---*\n");

		done()
	})

	it("pass #20 Basic Pass", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();


		expect(su.debugRow(0)).to.equal("|8|4|3|179|57|159|6|2|19|")
		expect(su.debugRow(1)).to.equal("|7|12|129|4|6|3|1|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|16|")
		expect(su.debugRow(4)).to.equal("|34|16|16|37|57|45|9|8|2|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|2|146|5|7|16|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|8|1|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|19|3|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
			"|843|000|620|\n"+
			"|700|463|158|\n"+
			"|650|208|437|\n"+
			"*---+---+---*\n"+
			"|275|800|340|\n"+
			"|000|000|982|\n"+
			"|098|020|570|\n"+
			"*---+---+---*\n"+
			"|900|547|813|\n"+
			"|134|682|795|\n"+
			"|587|030|264|\n"+
			"*---*---*---*\n");

		done()
	})

	it("pass #21 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();


		expect(su.debugRow(0)).to.equal("|8|4|3|179|57|159|6|2|9|")
		expect(su.debugRow(1)).to.equal("|7|2|29|4|6|3|1|5|8|")
		expect(su.debugRow(2)).to.equal("|6|5|19|2|19|8|4|3|7|")
		expect(su.debugRow(3)).to.equal("|2|7|5|8|19|169|3|4|16|")
		expect(su.debugRow(4)).to.equal("|34|16|16|37|57|45|9|8|2|")
		expect(su.debugRow(5)).to.equal("|34|9|8|13|2|146|5|7|16|")
		expect(su.debugRow(6)).to.equal("|9|26|26|5|4|7|8|1|3|")
		expect(su.debugRow(7)).to.equal("|1|3|4|6|8|2|7|9|5|")
		expect(su.debugRow(8)).to.equal("|5|8|7|19|3|19|2|6|4|")

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
			"|843|000|629|\n"+
			"|720|463|158|\n"+
			"|650|208|437|\n"+
			"*---+---+---*\n"+
			"|275|800|340|\n"+
			"|000|000|982|\n"+
			"|098|020|570|\n"+
			"*---+---+---*\n"+
			"|900|547|813|\n"+
			"|134|682|795|\n"+
			"|587|030|264|\n"+
			"*---*---*---*\n");
		done()
	})

	it("pass #22 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
			"|843|000|629|\n"+
			"|729|463|158|\n"+
			"|650|208|437|\n"+
			"*---+---+---*\n"+
			"|275|800|340|\n"+
			"|000|000|982|\n"+
			"|098|020|570|\n"+
			"*---+---+---*\n"+
			"|960|547|813|\n"+
			"|134|682|795|\n"+
			"|587|030|264|\n"+
			"*---*---*---*\n");
		done()
	})

	it("pass #23 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|629|\n"+
											"|729|463|158|\n"+
											"|651|208|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|010|000|982|\n"+
											"|098|020|570|\n"+
											"*---+---+---*\n"+
											"|962|547|813|\n"+
											"|134|682|795|\n"+
											"|587|030|264|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #24 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
											"|843|000|629|\n"+
											"|729|463|158|\n"+
											"|651|298|437|\n"+
											"*---+---+---*\n"+
											"|275|800|340|\n"+
											"|016|000|982|\n"+
											"|098|020|570|\n"+
											"*---+---+---*\n"+
											"|962|547|813|\n"+
											"|134|682|795|\n"+
											"|587|030|264|\n"+
											"*---*---*---*\n");
		done()
	})

	it("pass #25 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();



        expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|000|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|810|340|\n"+
        "|016|000|982|\n"+
        "|098|020|570|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|030|264|\n"+
        "*---*---*---*\n");
		done()
	})

	it("pass #26 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|000|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|810|346|\n"+
        "|016|000|982|\n"+
        "|098|320|570|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|030|264|\n"+
        "*---*---*---*\n");
		done()
	})

	it("pass #27 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

		expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|000|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|819|346|\n"+
        "|016|700|982|\n"+
        "|498|320|571|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|030|264|\n"+
        "*---*---*---*\n");
		done()
	})
    */

	it("pass #28 Basic Pass should show no change in set", function(done){
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solvePassBasic();
		solve.solveRegionExclusion();
		solve.solvePassBasic();
		solve.solveRowExclusion();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solveColExclusion();
		solve.solveRegionExclusion();
		solve.checkPairs();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();
		solve.solvePassBasic();

		solve.solvePassBasic();

        expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|100|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|819|346|\n"+
        "|316|750|982|\n"+
        "|498|326|571|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|031|264|\n"+
        "*---*---*---*\n");
		done()
	})

    it("pass #29 Solve with one final Basic Pass", function(done){
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solveRegionExclusion();
        solve.solvePassBasic();
        solve.solveRowExclusion();
        solve.solvePassBasic();
        solve.solveColExclusion();
        solve.solvePassBasic();
        solve.solveRegionExclusion();
        solve.solvePassBasic();
        solve.solveRowExclusion();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solveColExclusion();
        solve.solveRegionExclusion();
        solve.checkPairs();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();

        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();
        solve.solvePassBasic();

        expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|175|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|819|346|\n"+
        "|316|754|982|\n"+
        "|498|326|571|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|931|264|\n"+
        "*---*---*---*\n");
        done()
    })



    it("Just solve", function(done){
        solve.solve()

        expect(su.getStructure()).to.equal( "*---*---*---*\n"+
        "|843|175|629|\n"+
        "|729|463|158|\n"+
        "|651|298|437|\n"+
        "*---+---+---*\n"+
        "|275|819|346|\n"+
        "|316|754|982|\n"+
        "|498|326|571|\n"+
        "*---+---+---*\n"+
        "|962|547|813|\n"+
        "|134|682|795|\n"+
        "|587|931|264|\n"+
        "*---*---*---*\n");
        done()
    })
/*
	*/
})<file_sep>/src/view/view.jsx
/**
 * Sets up and runs the view
 * @file view.jsx
 * @author <NAME>
 */
var React   = require('react');
window.React = React

var SudokuBoard = require('./SudokuBoard.jsx')


/**
 * Renders the window using the current Sudoku at window.su
 * @function
 */
window.renderView = function() {
	React.render(
		<SudokuBoard sudoku={window.su}/>
	  ,
	  document.body
	);
}

/**
 * Calls a method and then calls window render
 * @example
 * window.dnr(alert, this, "This is an alert!")
 * @function
 * @param {Function} f The function to call.
 * @param {Function} [t=null] The context to call the function in such as this.
 * @param {arguments} [*=null] all remaining arguments are passed to the function
 */
window.dnr = function(f, t ){
	var args = Array.prototype.splice.call(arguments, 2);
	f.apply(t, args)
	window.renderView();
}

window.renderView();<file_sep>/docs/serve/0.0.0/debugger.js.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>HTML5 Sudoku App: Source: debugger.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: debugger.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>/**
 * Just some floating debug helper methods
 * @name Debugger
 * @module
 */

/**
 * Gets the current stack.
 * @function
 * @returns {string} The current stack as a string
 */
exports.getstack = function(){
	//create dubby error to get stack
	var e = new Error('stackTrace');
	//format stack
	var stack = e.stack.replace(/^[^\(]+?[\n$]/gm, '')
		.replace(/^\s+at\s+/gm, '')
		.replace(/^Object.&lt;anonymous>\s*\(/gm, '{anonymous}()@')
		.split('\n');
	//return stack
	return stack
}
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Debugger.html">Debugger</a></li></ul><h3>Classes</h3><ul><li><a href="puzzleMaker.html">puzzleMaker</a></li><li><a href="sudokuOBJ.html">sudokuOBJ</a></li><li><a href="sudokuSolver.html">sudokuSolver</a></li><li><a href="tileOBJ.html">tileOBJ</a></li><li><a href="tileStore.html">tileStore</a></li></ul><h3>Global</h3><ul><li><a href="global.html#a">a</a></li><li><a href="global.html#TileTypes">Tile Types</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Tue Aug 25 2015 18:08:45 GMT-1000 (Hawaiian Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
<file_sep>/src/js/puzzleMaker.js
/**
 * @file Puzzle Maker Code
 * @author <NAME>
 */

 /**
 * Puzzle Maker
 * {Not Implimented Yet}
 * @class puzzleMaker
 */

var puzzleMaker = function () {
	// body...
}

module.exports = puzzleMaker;<file_sep>/README.md
# HTML5-Sudoku
Simple React.js Sudoku app writen with Legit TDD and full documentation.

# Author
<NAME>

# Documentation
[Clicking this link](http://htmlpreview.github.io/?https://raw.githubusercontent.com/Eforen/HTML5-Sudoku/master/docs/index.html) will take you to the full documentaion for this project! Its awesome because it is extracted from the code meaning that the code is fully commented and that the docs can link to where the methods, classes, n things are defined with exact line numbers!

# Current Status
Base structure testing.

# To Do before implimenting GUI
- [x] Add static serving node.js to allow debugging in chrome without crossdomain issues.
- [x] Setup Testing for TDD and Browserify.

- [x] Create Sudoku Object/Class
- [x] Create tile store
- [x] Create tile object

- [ ] Create Sudoku solver

- [ ] Load Seed Puzzles from json

- [ ] Create Sudoku Maker

- [ ] Make Areas able to check available numbers and validity of numbers.

- [ ] Make brute force Sudoku Creater.

# Bugs:
None<file_sep>/test/test.sudokuOBJ.js
var expect = require("chai").expect;
var sudoku = require("../src/js/sudokuOBJ.js");
var tileStore = require("../src/js/tileStore.js");
var tileOBJ = require("../src/js/tileOBJ.js");

var tokens = require("../src/js/tokenENUM.js");

describe("sudoku Object", function() {

	var su = null;
	var testJSON = "{}";
	var testOBJ = {};

	beforeEach(function(done) {
		test = '{"name": "<NAME>",	"puzzle": "043000620700403008600208007075000340000000000098000570900507003100602005087000260"}';
		testOBJ = {
			name: "<NAME>",	
			puzzle: "043000620700403008600208007075000340000000000098000570900507003100602005087000260"
		}
		su = new sudoku();
		//su = null; //Debug setup expectation
		expect(su).not.to.be.null; //Test setup expectation
		done();
	})

	it("should instansiate and be available", function(done){
		expect(su).not.to.be.null;
		done();
	})

	describe("lines", function(){
		describe("rows", function() {
			it("should be and array", function(done){
				expect(su.getRows()).to.be.an('array');
				done();
			})

			it("should create 9", function(done){
				expect(su.getRows()).to.have.length(9);
				done();
			})

			it("should all be tileStores", function(done){
				for (var i = 0; i < 9; i++) {
					expect(su.getRow(i)).to.be.an.instanceof(tileStore);
				}
				done();
			})

			it("should all be full of tileOBJs", function(done){
				for (var r = 0; r < 9; r++) {
					var ro = su.getRow(r);
					for (var c = 0; c < 9; c++) {
						expect(ro.tiles[c]).to.be.instanceof(tileOBJ);
					}
				}
				done();
			})
		})

		describe("cols", function() {
			it("should be and array", function(done){
				expect(su.getCols()).to.be.an('array');
				done();
			})

			it("should create 9", function(done){
				expect(su.getCols()).to.have.length(9);
				done();
			})

			it("should all be tileStores", function(done){
				for (var i = 0; i < 9; i++) {
					expect(su.getCol(i)).to.be.an.instanceof(tileStore);
				}
				done();
			})

			it("should all be full of tileOBJs", function(done){
				for (var c = 0; c < 9; c++) {
					var co = su.getCol(c);
					for (var r = 0; r < 9; r++) {
						expect(co.tiles[r]).to.be.instanceof(tileOBJ);
					}
				}
				done();
			})
		})
	})


	describe("regions", function() {
		it("should be and array", function(done){
			expect(su.getRegions()).to.be.an('array');
			done();
		})

		it("should create 9", function(done){
			expect(su.getRegions()).to.have.length(9);
			done();
		})

		it("should all be tileStores", function(done){
			for (var i = 0; i < 9; i++) {
				expect(su.getRegion(i)).to.be.an.instanceof(tileStore);
			}
			done();
		})

		it("get from posision should return the correct tileStores", function(done){
			for (var x = 0; x < 9; x++) {
				for (var y = 0; y < 9; y++) {
					var xx = null;
					if(x > 0 && x < 3) xx = 0;
					if(x > 2 && x < 6) xx = 1;
					if(x > 5 && x < 9) xx = 2;
					var yy = null;
					if(y > 0 && y < 3) yy = 0;
					if(y > 2 && y < 6) yy = 1;
					if(y > 5 && y < 9) yy = 2;

					expect(su.getRegion(x, y)).to.equal(su.getRegion(3*yy+xx));
				}
			}
			done();
		})

		it("should all be full of tileOBJs", function(done){
			for (var r = 0; r < 9; r++) {
				var ro = su.getRegion(r);
				for (var i = 0; i < 9; i++) {
					expect(ro.tiles[i]).to.be.instanceof(tileOBJ);
				}
			}
			done();
		})
	})

	describe("Data", function(){

		beforeEach(function(done) {
			//su = sudoku.loadFromJSON(test);
			su = sudoku.loadFromOBJ(testOBJ);
			//su = null; //Debug setup expectation
			expect(su).not.to.be.null; //Test setup expectation
			expect(su).to.be.instanceof(sudoku); //Test setup expectation
			done();
		})
		it("should load from JSON", function(done){
			//var su = sudoku.loadFromJSON(test);
			su = sudoku.loadFromOBJ(testOBJ);
			done();
		})
		describe("should be the correct data:", function(){
			it("token check...", function(done){
				//console.log("wtf! "+tokens.a+" "+tokens.b)
				expect(su.getTile(1,0).getToken()).to.equal(tokens.d);
				expect(su.getTile(2,0).getToken()).to.equal(tokens.c);

				// 043 000 620
				expect(su.getTile(1,0).getToken()).to.equal(4);
				expect(su.getTile(2,0).getToken()).to.equal(3);
				expect(su.getTile(6,0).getToken()).to.equal(6);
				expect(su.getTile(7,0).getToken()).to.equal(2);

				// 700 403 008
				expect(su.getTile(0,1).getToken()).to.equal(7);
				expect(su.getTile(3,1).getToken()).to.equal(4);
				expect(su.getTile(5,1).getToken()).to.equal(3);
				expect(su.getTile(8,1).getToken()).to.equal(8);

				// 600 208 007
				expect(su.getTile(0,2).getToken()).to.equal(6);
				expect(su.getTile(3,2).getToken()).to.equal(2);
				expect(su.getTile(5,2).getToken()).to.equal(8);
				expect(su.getTile(8,2).getToken()).to.equal(7);

				// 075 000 340
				expect(su.getTile(1,3).getToken()).to.equal(7);
				expect(su.getTile(2,3).getToken()).to.equal(5);
				expect(su.getTile(6,3).getToken()).to.equal(3);
				expect(su.getTile(7,3).getToken()).to.equal(4);

				// 000 000 000

				// 098 000 570
				expect(su.getTile(1,5).getToken()).to.equal(9);
				expect(su.getTile(2,5).getToken()).to.equal(8);
				expect(su.getTile(6,5).getToken()).to.equal(5);
				expect(su.getTile(7,5).getToken()).to.equal(7);

				// 900 507 003
				expect(su.getTile(0,6).getToken()).to.equal(9);
				expect(su.getTile(3,6).getToken()).to.equal(5);
				expect(su.getTile(5,6).getToken()).to.equal(7);
				expect(su.getTile(8,6).getToken()).to.equal(3);
				
				// 100 602 005
				expect(su.getTile(0,7).getToken()).to.equal(1);
				expect(su.getTile(3,7).getToken()).to.equal(6);
				expect(su.getTile(5,7).getToken()).to.equal(2);
				expect(su.getTile(8,7).getToken()).to.equal(5);
				
				// 087 000 260
				expect(su.getTile(1,8).getToken()).to.equal(8);
				expect(su.getTile(2,8).getToken()).to.equal(7);
				expect(su.getTile(6,8).getToken()).to.equal(2);
				expect(su.getTile(7,8).getToken()).to.equal(6);
				done();
			})

			it("type check...", function(done){
				// 043 000 620
				expect(su.getTile(0,0).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(1,0).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(2,0).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(3,0).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(4,0).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,0).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(6,0).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(7,0).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(8,0).getType()).to.equal(tileOBJ.types.blank);

				// 700 403 008
				expect(su.getTile(0,1).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(1,1).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(2,1).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(3,1).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(4,1).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,1).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(6,1).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(7,1).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(8,1).getType()).to.equal(tileOBJ.types.locked);

				// 600 208 007
				expect(su.getTile(0,2).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(1,2).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(2,2).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(3,2).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(4,2).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,2).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(6,2).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(7,2).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(8,2).getType()).to.equal(tileOBJ.types.locked);

				// 075 000 340
				expect(su.getTile(0,3).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(1,3).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(2,3).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(3,3).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(4,3).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,3).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(6,3).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(7,3).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(8,3).getType()).to.equal(tileOBJ.types.blank);

				// 000 000 000
				expect(su.getTile(0,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(1,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(2,4).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(3,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(4,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,4).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(6,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(7,4).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(8,4).getType()).to.equal(tileOBJ.types.blank);

				// 098 000 570
				expect(su.getTile(0,5).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(1,5).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(2,5).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(3,5).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(4,5).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,5).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(6,5).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(7,5).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(8,5).getType()).to.equal(tileOBJ.types.blank);

				// 900 507 003
				expect(su.getTile(0,6).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(1,6).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(2,6).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(3,6).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(4,6).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,6).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(6,6).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(7,6).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(8,6).getType()).to.equal(tileOBJ.types.locked);
				
				// 100 602 005
				expect(su.getTile(0,7).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(1,7).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(2,7).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(3,7).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(4,7).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,7).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(6,7).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(7,7).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(8,7).getType()).to.equal(tileOBJ.types.locked);
				
				// 087 000 260
				expect(su.getTile(0,8).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(1,8).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(2,8).getType()).to.equal(tileOBJ.types.locked);

				expect(su.getTile(3,8).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(4,8).getType()).to.equal(tileOBJ.types.blank);
				expect(su.getTile(5,8).getType()).to.equal(tileOBJ.types.blank);

				expect(su.getTile(6,8).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(7,8).getType()).to.equal(tileOBJ.types.locked);
				expect(su.getTile(8,8).getType()).to.equal(tileOBJ.types.blank);

				done();
			})
		})

		describe("structure", function() {

			it("should be the correct tileOBJs", function(done){
				for (var x = 0; x < 9; x++) {
					for (var y = 0; y < 9; y++) {
						var r = su.getRow(y);
						var c = su.getCol(x);
						expect(r.tiles[x]).to.equal(c.tiles[y]);
					}
				}
				done();
			})

			it("get tile should get the correct tileOBJ", function(done){
				for (var x = 0; x < 9; x++) {
					for (var y = 0; y < 9; y++) {
						var r = su.getRow(y);
						var c = su.getCol(x);
						expect(r.tiles[x]).to.equal(c.tiles[y]);
						expect(su.getTile(x, y)).to.equal(r.tiles[x]);
					}
				}
				done();
			})

			it("regions should all be the correct tileOBJs", function(done){
				var r = su.getRegions();
				for (var x = 0; x < 9; x++) {
					for (var y = 0; y < 9; y++) {
						var rx = null;
						if(x > 0 && x < 3) rx = 0;
						if(x > 2 && x < 6) rx = 1;
						if(x > 5 && x < 9) rx = 2;
						var ry = null;
						if(y > 0 && y < 3) ry = 0;
						if(y > 2 && y < 6) ry = 1;
						if(y > 5 && y < 9) ry = 2;

						expect(r[3*ry+rx].tiles[3*parseInt(y%3)+parseInt(x%3)]).to.equal(su.getTile(x, y));
					}
				}
				done();
			})

			describe("debug methods", function() {

				it("should return correct structure in string", function(done){
					
					/*
	*---*---*---*
	|043|000|620|
	|700|403|008|
	|600|208|007|
	*---+---+---*
	|075|000|340|
	|000|000|000|
	|098|000|570|
	*---+---+---*
	|900|507|003|
	|100|602|005|
	|087|000|260|
	*---*---*---*
					*/
					var target =	"*---*---*---*\n"+
									"|043|000|620|\n"+
									"|700|403|008|\n"+
									"|600|208|007|\n"+
									"*---+---+---*\n"+
									"|075|000|340|\n"+
									"|000|000|000|\n"+
									"|098|000|570|\n"+
									"*---+---+---*\n"+
									"|900|507|003|\n"+
									"|100|602|005|\n"+
									"|087|000|260|\n"+
									"*---*---*---*\n"
					expect(su.getStructure()).to.equal(target);

					done()
				})

				it("should print debug of tiles in row with .debugRow(y)", function(done){

					expect(su.debugRow(0)).to.equal("||4|3||||6|2||")
					expect(su.debugRow(1)).to.equal("|7|||4||3|||8|")
					expect(su.debugRow(2)).to.equal("|6|||2||8|||7|")
					expect(su.debugRow(3)).to.equal("||7|5||||3|4||")
					expect(su.debugRow(4)).to.equal("||||||||||")
					expect(su.debugRow(5)).to.equal("||9|8||||5|7||")
					expect(su.debugRow(6)).to.equal("|9|||5||7|||3|")
					expect(su.debugRow(7)).to.equal("|1|||6||2|||5|")
					expect(su.debugRow(8)).to.equal("||8|7||||2|6||")

					done();
				})

				it("should print debug of tiles in row with .debugRow(y) with guesses", function(done){

					var row = su.getRow(0).tiles

					// a b c  d e f  g h i
					// 1 2 3  4 5 6  7 8 9

					var arr = []
					arr[tokens.e] = true;
					arr[tokens.h] = true;
					row[0].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					row[3].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					row[4].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.i] = true;
					row[5].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.i] = true;
					row[8].setGuesses(arr)

					expect(su.debugRow(0)).to.equal("|58|4|3|179|1579|159|6|2|19|")
					expect(su.debugRow(1)).to.equal("|7|||4||3|||8|")
					expect(su.debugRow(2)).to.equal("|6|||2||8|||7|")
					expect(su.debugRow(3)).to.equal("||7|5||||3|4||")
					expect(su.debugRow(4)).to.equal("||||||||||")
					expect(su.debugRow(5)).to.equal("||9|8||||5|7||")
					expect(su.debugRow(6)).to.equal("|9|||5||7|||3|")
					expect(su.debugRow(7)).to.equal("|1|||6||2|||5|")
					expect(su.debugRow(8)).to.equal("||8|7||||2|6||")

					done();
				})

				it("should print debug of tiles in col with .debugCol(x)", function(done){


					expect(su.debugCol(0)).to.equal("||7|6||||9|1||")

					done();
				})

				it("should print debug of tiles in col with .debugCol(x) with guesses", function(done){

					var col = su.getCol(0).tiles

					// a b c  d e f  g h i
					// 1 2 3  4 5 6  7 8 9

					var arr = []
					arr[tokens.e] = true;
					arr[tokens.h] = true;
					col[0].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					col[3].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					col[4].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.i] = true;
					col[5].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.i] = true;
					col[8].setGuesses(arr)

					expect(su.debugCol(0)).to.equal("|58|7|6|179|1579|159|9|1|19|")

					done();
				})

				it("should print debug of tiles in region with .debugRegion(y)", function(done){

					expect(su.debugRegion(0,0)).to.equal("||4|3|7|||6|||")

					done();
				})

				it("should print debug of tiles in region with .debugRegion(x, y) with guesses", function(done){

					var region = su.getRegion(0,0).tiles

					// a b c  d e f  g h i
					// 1 2 3  4 5 6  7 8 9

					var arr = []
					arr[tokens.e] = true;
					arr[tokens.h] = true;
					region[0].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					region[4].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.g] = true;
					arr[tokens.i] = true;
					region[5].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.e] = true;
					arr[tokens.i] = true;
					region[7].setGuesses(arr)

					arr = []
					arr[tokens.a] = true;
					arr[tokens.i] = true;
					region[8].setGuesses(arr)

					expect(su.debugRegion(0,0)).to.equal("|58|4|3|7|179|1579|6|159|19|")

					done();
				})
			})
		})
	})
})<file_sep>/test/test-sudokuTile.jsx
//jsdom = require("jsdom")

sinon = require("mocha-sinon")

require("./dom_helper.js")

var expect = require("chai").expect;

var React          = require('react')
var ReactAddons    = require('react/addons') // require the addons
var ReactTestUtils = React.addons.TestUtils  // <- YEAH!

var tileOBJ = require("../src/js/tileOBJ.js");

var tokens = require("../src/js/tokenENUM.js");
var debug = require("../src/js/debugger.js");

describe("sudokuTile Comp", function() {

    beforeEach(function() {
        var container = this.document.createElement('div')
    })
	it("create the correct HTML on Set", function(done){

        var tileHTML = TestUtils.renderIntoDocument((<sudokuTile x={2} y={4} tile={tile} />), container)
		console.log(tileHTML.innerHTML())
		done();
	})
})<file_sep>/src/js/sudokuSolver.js
/**
 * @file SudokuSolver Code
 * @author <NAME>
 */

console.log("Loaded SudokuSolver.js");
var sudokuOBJ = require("./sudokuOBJ.js");
var tileStore = require("./tileStore.js");
var tileOBJ   = require("./tileOBJ.js");
var token = require("./tokenENUM.js");

/**
 * Holds all the logic to solve a sudoku or preform parts of solving.
 * @todo Document this object
 * @class
 */

var sudokuSolver = function(sudoku){
	//Private Vars
	/**
	 * @todo Document this member
	 * @member sudokuSolver#su
	 * @private
	 */
	var su = sudoku;

	//Public Vars

	//Methods
	/**
	 * @todo Document this method
	 * @method sudokuSolver#prepSudoku
	 */
	this.prepSudoku=function(){
		var defaultGuesses = [];
			defaultGuesses[token.a] = true;
			defaultGuesses[token.b] = true;
			defaultGuesses[token.c] = true;
			defaultGuesses[token.d] = true;
			defaultGuesses[token.e] = true;
			defaultGuesses[token.f] = true;
			defaultGuesses[token.g] = true;
			defaultGuesses[token.h] = true;
			defaultGuesses[token.i] = true;

		var tile = null;
		for (var x = 0; x < 9; x++) {
			for (var y = 0; y < 9; y++) {
				tile = su.getTile(x,y);
				if(tile.getType()!=tileOBJ.types.locked){
					tile.setGuesses(defaultGuesses);
				}
			}
		}
	}


	/**
	 * @todo Document this method
	 * @method sudokuSolver#getSudoku
	 */
	this.getSudoku = function(){
		return su;
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveForRow
	 */
	this.solveForRow = function(y){
		this.excludeInSet(su.getRow(y));
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveForCol
	 */
	this.solveForCol = function(x){
		this.excludeInSet(su.getCol(x));
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveForRegion
	 */
	this.solveForRegion = function(x, y){
		this.excludeInSet(su.getRegion(x, y));
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#excludeSet
	 */
	this.excludeSet = function(tile, container){

		for (var n = 1; n < 10; n++) {
			for (var i = 0; i < container.tiles.length; i++) {
				if(container.tiles[i].getToken() === n || container.tiles[i].getType() === tileOBJ.types.locked || container.tiles[i].getType() === tileOBJ.types.set){
					console.log("Making "+n+"|"+i+" falsy")
					tile.setGuess(n, false);
					break;
				}
			}
		}
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#excludeInSet
	 */
	this.excludeInSet = function(container){
		var data = []

		var log = "" //Debug
		
		//run through set and mark all present tokens as false in data set leave all others null
		for (var i = 0; i < container.tiles.length; i++) {
			log += i+" loop"+", "
			//If tile is guess then skip it
			if(container.tiles[i].getType() === tileOBJ.types.guess){
				log += i+" skip"+", "
				continue
			}
			//If tile is set then set data as false
			if(container.tiles[i].getType() == tileOBJ.types.locked || container.tiles[i].getType() == tileOBJ.types.set){
				log += i+" set "+container.tiles[i].getToken()+". "
				data[container.tiles[i].getToken()] = false
			}
		}

		log += "|"+data+"|"

		//Kill all bad guesses with the data array
		for (var i = 0; i < container.tiles.length; i++){
			log += i+" loop"+", "
			if(typeof(container.tiles[i]) !== "undefined"){
				log += i+" set"+". "
				container.tiles[i].setGuesses(data)
			}
		}
		//console.log(log)
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#excludeGuess
	 */
	this.excludeGuess = function(container, includeGuesses, debug){
		if(includeGuesses == null) includeGuesses = false
		var data = []
		for (var n = 1; n < 10; n++) {
			data[n]={
				inMoreThenOne: 0,
				index: 0
			}
			for (var i = 0; i < container.tiles.length; i++) {
				if(container.tiles[i].getType() === tileOBJ.types.guess){
					if(container.tiles[i].getGuess(n)){
						data[n].inMoreThenOne++
						data[n].index = i
					}
				}
				if(container.tiles[i].getType() == tileOBJ.types.locked || container.tiles[i].getType() == tileOBJ.types.set){
					if(container.tiles[i].getToken() == n){
						data[n].inMoreThenOne += 10
						data[n].index = i
					}
				}
				/*
				*/
			}
		}
		if(typeof(window) != "undefined") window.testGuess = data //debug
		for (var n = 1; n < 10; n++) {
			/*if(n == 4 && debug === true) {//debug 
				console.log("\n\n********************************************\nSolve for N"+n+" is "+data[n].inMoreThenOne+"|"+data[n].index+"\n********************************************\n\n")
			}*/
			if(data[n].inMoreThenOne === 1){
				//console.log("found one")
				container.tiles[data[n].index].setToken(n)
				container.tiles[data[n].index].setType(tileOBJ.types.set)
			}
		}
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solvePassBasic
	 */
	this.solvePassBasic = function(){
		for (var x = 0; x < 9; x++) {
			for (var y = 0; y < 9; y++) {
				//if(y === 7) console.log("Solving For r"+9+" c"+x)
				this.solveForRow(y)
				this.solveForCol(x)
				this.solveForRegion(x)
			}
		}

		var tile = null;
		for (var x = 0; x < 9; x++) {
			for (var y = 0; y < 9; y++) {
				tile = this.getSudoku().getTile(x, y)
				if(tile.getType() === tileOBJ.types.guess){
					var count = 0
					var guesses = tile.getGuesses()
					var lastToken = 0
					for (var i = 0; i < guesses.length; i++) {
						if(guesses[i]){
							count++
							lastToken = i
						}
					}
					if(count === 1) {
						tile.setToken(lastToken)
						tile.setType(tileOBJ.types.set)
					}
				}
			}
		}
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveRegionExclusion
	 */
	this.solveRegionExclusion = function(){
		var regions = this.getSudoku().getRegions()
		for (var i = 0; i < 9; i++) {
			this.excludeGuess(regions[i], true)
		}
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveRowExclusion
	 */
	this.solveRowExclusion = function(){
		//var row = this.getSudoku().getRows()
		for (var i = 0; i < 9; i++) {
			this.excludeGuess(this.getSudoku().getRow(i), true)
		}
	}

	/**
	 * @todo Document this method
	 * @method sudokuSolver#solveColExclusion
	 */
	this.solveColExclusion = function(){
		for (var i = 0; i < 9; i++) {
			//console.log(su.debugCol(i)) //debug
			this.excludeGuess(this.getSudoku().getCol(i), true)
		}
	}

	/**
	 * This method preforms a pair exclusion test on all rows
	 * @method sudokuSolver#checkPairsRow
	 */
	this.checkPairsRow = function(){
		for (var i = 0; i < 9; i++) {
			//console.log(su.debugCol(i)) //debug
			this.excludePairGuess(this.getSudoku().getRow(i))
		}
	}

	/**
	 * This method preforms a pair exclusion test on all columns
	 * @method sudokuSolver#checkPairsCol
	 */
	this.checkPairsCol = function(){
		for (var i = 0; i < 9; i++) {
			//console.log(su.debugCol(i)) //debug
			this.excludePairGuess(this.getSudoku().getCol(i))
		}
	}

	/**
	 * This method preforms a pair exclusion test on all regions
	 * @method sudokuSolver#checkPairsRegion
	 */
	this.checkPairsRegion = function(){
		for (var i = 0; i < 9; i++) {
			//console.log(su.debugCol(i)) //debug
			this.excludePairGuess(this.getSudoku().getRegion(i))
		}
	}

	/**
	 * This method preforms a pair exclusion test on all rows, columns, and regions
	 * @method sudokuSolver#checkPairs
	 */
	this.checkPairs = function(){
		this.checkPairsRow()
		this.checkPairsCol()
		this.checkPairsRegion()
	}


	/**
	 * 
	 * This method preforms a pair exclusion test on the given {@link tileStore}
	 * @method sudokuSolver#excludeGuess
	 */
	this.excludePairGuess = function(container, debug){
		var data = []
		for (var n = 1; n < 10; n++) {
			var guess = []
			var count = 0
			for (var i = 0; i < container.tiles.length; i++) {
				if(container.tiles[i].getType() === tileOBJ.types.guess){
					//get guesses
					guess = container.tiles[i].getGuesses()
					count = 0
					//count the actual values
					for(var g = 0; g<guess.length; g++){
						if(guess[g] === true){
							count+=1 // Add one for every guess in the base set
						}
					}
					//if is a pair
					if(count === 2){ //base set has only 2 guesses
						var guess2 = []
						var same = true //define the var outside the loop to avoid object creation for speed
						for (var ii = i+1; ii < container.tiles.length; ii++) {//check every other tile for the same values
							same = true
							count = 0 //reuse and reset the counter to 0
							guess2 = container.tiles[ii].getGuesses() //get current secondary tiles set of guesses
							for(var g = 0; g<guess2.length; g++) {
								if (guess2[g] !== guess[g]) { // If it does not match the base set
									same = false //backup to insure it does not stop on the 3rd guess and not match thus looking like a pair
									break
								}else if(guess2[g] === true){
									count++ //Backup to insure that the other is a pair not just something that has for example an empty guess list
								}
							}
							if(same === true && count === 2){
								//We have found a pair now kill these guesses in all others that are not this pair
								var killSet = []
								for(var g = 0; g<guess2.length; g++) {
									if (guess2[g] == true) { // If it matches the base set
										killSet[g] = false //set it to false so when applied to target tiles it removes both elements of the pair if they are present
									}
								}
								for (var k = 0; k < container.tiles.length; k++) {
									//kill guesses that are in this set in all other tiles.
									if(k !== i && k !== ii){
										if(container.tiles[k].getToken() !== tileOBJ.types.locked || container.tiles[k].getToken() !== tileOBJ.types.set){
											container.tiles[k].setGuesses(killSet)
										}
									}
								}
							}
						}
					}

				}
			}
		}
	}

    this.solve = function(){
        var lastPass = 0
        var thisPass = 0
        var solved = false
        var failed = false
        var lastState = ""
        var thisState = ""

        while(solved === false) {

            switch(thisPass){
                case sudokuSolver.solvers.basicPass:
                    console.log("solvePassBasic")
                    this.solvePassBasic();
                    break
                case sudokuSolver.solvers.RowExclusion:
                    console.log("RowExclusion")
                    this.solveRegionExclusion();
                    break
                case sudokuSolver.solvers.ColExclusion:
                    console.log("ColExclusion")
                    this.solveRowExclusion();
                    break
                case sudokuSolver.solvers.RegionExclusion:
                    console.log("RegionExclusion")
                    this.solveColExclusion();
                    break
                case sudokuSolver.solvers.checkPairs:
                    console.log("checkPairs")
                    this.checkPairs();
                    break
                default:
                    solved = true
                    failed = true
                    console.log("Solver not found!")
            }

            lastState = thisState
            thisState = su.getStructure(true, true)
            console.log(thisState)

            if(su.isSolved()){
                solved = true;
                break
            }

            if(lastState == thisState) {
                //This pass did nothing
                //if(lastPass > thisStep){
                if(thisPass < sudokuSolver.solvers.lastSolver){
                    if(lastPass >= thisPass && lastPass != sudokuSolver.solvers.firstSolver){
                        console.log("WTF2!")
                        //If the last pass in greater then this one then that means that we where checking for basic changes
                        //Should switch back to where it was and run the next step.
                        thisPass = lastPass + 1
                    } else{
                        console.log("WTF3!")
                        thisPass++
                    }
                } else{
                    console.log("WTF1!")
                    lastPass = sudokuSolver.solvers.firstSolver
                    thisPass = sudokuSolver.solvers.firstSolver
                }
            } else{
                console.log("WTF3!")
                //This pass did something so check basic pass
                lastPass = thisPass
                thisPass = sudokuSolver.solvers.firstSolver
            }
        }

    }



	//Start of Constructor

	this.prepSudoku();

	//End of Constructor
}

sudokuSolver.solvers = {
    firstSolver: 0,
    basicPass: 0,
	RegionExclusion: 1,
	RowExclusion: 2,
	ColExclusion: 3,
	checkPairs: 4,
    lastSolver: 4
}

module.exports = sudokuSolver;<file_sep>/src/js/debugger.js
/**
 * Just some floating debug helper methods
 * @name Debugger
 * @module
 */

/**
 * Gets the current stack.
 * @function
 * @returns {string} The current stack as a string
 */
exports.getstack = function(){
	//create dubby error to get stack
	var e = new Error('stackTrace');
	//format stack
	var stack = e.stack.replace(/^[^\(]+?[\n$]/gm, '')
		.replace(/^\s+at\s+/gm, '')
		.replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@')
		.split('\n');
	//return stack
	return stack
}
<file_sep>/test/dom_helper.js
/*
//jsdom = require("jsdom")

require("mocha-sinon")

// move into beforeEach and flip global.window.close on to improve
// cleaning of environment during each test and prevent memory leaks
document = jsdom.jsdom('<html><body></body></html>', jsdom.level(1, 'core'))

beforeEach( function(){
    this.document = document
    global.document = this.document
    global.window = this.document.parentWindow
})

afterEach( function(){
    // setting up and closing a "window" every run is really heavy
    // it prevents contamination between tests and prevents memory leaks
    global.window.close()
})
    */<file_sep>/test/test.hex2rgb.js
var expect = require("chai").expect;
var hex2rgb = require("../src/js/lib/hex2rgb");

describe("hex to rgb conversion", function() {
	it("should fail with less than 3 characters", function(done){
		hex2rgb("#ff", function(err){
			expect(err).to.exist;
			done();
		});
	})
	it("should fail with more than 6 characters", function(done){
		hex2rgb("#ffaabbs", function(err){
			expect(err).to.exist;
			done();
		});
	})
	it("should convert hex to rgb succcessfully", function(done){
		hex2rgb("#ffaa55", function(err, rgb){
			expect(err).to.be.null;
			expect(rgb).to.deep.equal([255,170,85]);
			done();
		});
	})
})<file_sep>/src/js/tileOBJ.js
/**
 * @file tileOBJ Code
 * @author <NAME>
 */

 console.log("Loaded tileOBJ.js");

var tokens = require("./tokenENUM.js");

/**
 * This object stores data to describe a tile in the sudoku.
 * @module tileOBJ
 * @class
 */
var tileOBJ = function(){
	/**
	 * Tells if the this instance has been setup or not.
	 * @member tileOBJ#isSetup
	 * @type {Boolean}
	 */
	this.isSetup = false;

	/**
	 * Stores a refrence to the {@link tileStore} that contains all the tiles in the same row.
	 * @member tileOBJ#_row
	 * @type {tileStore}
	 * @private
	 */
	/**
	 * Stores a refrence to the {@link tileStore} that contains all the tiles in the same column.
	 * @member tileOBJ#_column
	 * @type {tileStore}
	 * @private
	 */
	/**
	 * Stores a refrence to the {@link tileStore} that contains all the tiles in the same region.
	 * @member tileOBJ#_region
	 * @type {tileStore}
	 * @private
	 */
	/**
	 * Stores a copy of the X position.
	 * @readonly
	 * @member tileOBJ#_x
	 * @type {Number}
	 * @private
	 */
	/**
	 * Stores a copy of the Y position.
	 * @readonly
	 * @member tileOBJ#_y
	 * @type {Number}
	 * @private
	 */
	var _row, _col, _region, _x, _y;

	/**
	 * Gets all remaining valid tokens.
	 * @method tileOBJ#available
	 * @returns {number[]} some stuff.
	 */
	this.setup = function(row, col, region, x, y){
		_row = row;
		_col = col;
		_region = region;
		_x = x;
		_y = y;
		this.isSetup = true;
	}

	/**
	 * Gets the stored refrence to the {@link tileStore} that contains all the tiles in the same row.
	 * @method tileOBJ#getRow
	 * @returns {tileStore}
	 */
	this.getRow = function(){
		return _row;
	}

	/**
	 * Gets the stored refrence to the {@link tileStore} that contains all the tiles in the same column.
	 * @method tileOBJ#getCol
	 * @returns {tileStore}
	 */
	this.getCol = function(){
		return _col;
	}

	/**
	 * Gets the stored refrence to the {@link tileStore} that contains all the tiles in the same region.
	 * @method tileOBJ#getRegion
	 * @returns {tileStore}
	 */
	this.getRegion = function(){
		return _region;
	}

	/**
	 * Gets the stored copy of the X position.
	 * @readonly
	 * @method tileOBJ#getX
	 * @returns {Number}
	 */
	this.getX = function(){
		return _x;
	}

	/**
	 * Gets the stored copy of the Y position.
	 * @readonly
	 * @method tileOBJ#getY
	 * @returns {Number}
	 */
	this.getY = function(){
		return _y;
	}

	/**
	 * Stores the token value of this tile.
	 * @member tileOBJ#_value
	 * @type {Number}
	 * @private
	 */
	this._value = 1;

	/**
	 * Stores the type of this tile.
	 * @member tileOBJ#_value
	 * @type {Number}
	 * @private
	 */
	this._type = 1;

	/**
	 * Stores the type of this tile.
	 * @method tileOBJ#set
	 * @param {tokenENUM} val - The desired token for this tile.
	 * @param {tileOBJ.types} [type=tileOBJ.types.set] - (Optional) The desired type for this tile.
	 */
	this.set = function(val, type){
		this._value = val;
		if(typeof(type) == "undefined") this._type = tileOBJ.types.set
		else this._type = type;
	}

	/**
	 * Gets an object that represents the data in this {@link tileOBJ}.
	 * @method tileOBJ#get
	 * @returns {tokenENUM} object.token - The token that the tile currently is set to.
	 * @returns {tileOBJ.types} object.type - The type this tile currently is set to.
	 * @private
	 */
	this.get = function(){
		return {
			token: this._value,
			type: this._type
		}
	}

	/**
	 * Gets the [Type]{@link tileOBJ#types} of this tileOBJ.
	 * @readonly
	 * @method tileOBJ#getType
	 * @returns {Number}
	 */
	this.getType=function(){
		return this._type;
	}

	/**
	 * Sets the [Type]{@link tileOBJ#types} of this tileOBJ.
	 * @readonly
	 * @method tileOBJ#setType
	 * @returns {Number}
	 */
	this.setType=function(t){
		this._type = t;
	}

	
	/**
	 * Gets the [Token]{@link tokenENUM} of this tileOBJ.
	 * @readonly
	 * @method tileOBJ#getToken
	 * @returns {Number}
	 */
	this.getToken=function(){
		return this._value;
	}

	/**
	 * Sets the [Token]{@link tokenENUM} of this tileOBJ.
	 * @readonly
	 * @method tileOBJ#setToken
	 * @returns {Number}
	 */
	this.setToken=function(v){
		this._value = v;
		this._type = tileOBJ.types.set
	}

	/**
	 * Stores the tiles guesses as token values.
	 * @member tileOBJ#_guesses
	 * @type {tokenENUM[]}
	 */
	this._guesses = [];

	/**
	 * Stores a guess for this tile.
	 * @method tileOBJ#setGuess
	 * @param {tokenENUM} val - The desired token for this tile.
	 * @param {boolean} [state=true] - (Optional) The desired state of this guess for tile.
	 */
	this.setGuess = function(token, state){
		if(typeof(state) == "undefined") state = true;
		this._guesses[token] = state;

		this.checkGuessState();
	}

	/**
	 * This method is used in guess manipulation functions to check it the tiles type should be changed.
	 * @method tileOBJ#checkGuessState
	 * @private 
	 */
	this.checkGuessState = function(){
		//set counter for guess
		var count = 0;
		for (var i = 0; i < this._guesses.length; i++) {
			if(this._guesses[i] === true) count++;
		}
		if(this._type == tileOBJ.types.blank && count > 0) this._type = tileOBJ.types.guess;
		else if(this._type == tileOBJ.types.guess && count === 0) this._type = tileOBJ.types.blank;
	}


	/**
	 * This function will unset the provided token.
	 * This is just a simple helper funtion that basicly calls instance.[setGuess]{@link tileOBJ#set}(token, false)
	 * @see {@link tileOBJ#setGuess}
	 * @method tileOBJ#unsetGuess
	 */
	this.unsetGuess = function(token){
		this._guesses[token] = false;
		this.checkGuessState();
	}

	/**
	 * Gets state of the token provided.
	 * @method tileOBJ#getGuess
	 * @param {tokenENUM} token - The token to retrieve state of.
	 * @return {boolean} If the token provided token is a guess on this tile and if it is an active guess.
	 */
	this.getGuess = function(token){
		if(typeof(this._guesses[token]) == "undefined") return false;
		if(this._guesses[token] === true) return true;
		return false;
	}

	/**
	 * Retreves all the guesses for the current tile in an array.
	 * @example
	 * [null,true,true,true,true,true,true,true,true,true]
	 * @method tileOBJ#getGuesses
	 * @return the array of guesses
	 */
	this.getGuesses = function(){
		return this._guesses;
	}

	/**
	 * Sets guesses using an array.
	 * @example
	 * tile = new Tile();
	 * ...
	 * var arr = [];
	 *
	 * // The array does not need to contain a value for all 9 tokens. Only values set in the array are touched.
	 * arr[tokenENUM.c] = true;
	 * arr[tokenENUM.d] = true;
	 * arr[tokenENUM.i] = true;
	 *
	 * // You can insure that a token is false by setting it in the array to false
	 * arr[tokenENUM.f] = false;
	 *
	 * console.log(arr);
	 * // Output: [null,null,null,true,true,null,false,null,null,true]
	 * tile.setGuesses(arr);
	 *
	 * console.log(tile.getGuesses());
	 * // Output: [null,false,false,true,true,false,false,false,false,true]
	 * @method tileOBJ#setGuesses
	 */
	this.setGuesses = function(data){
		if(Array.isArray(data)) {
			var guesses = this._guesses
			var check = function(token){
				if(data[token] === true || data[token] === false){
					guesses[token] = data[token];
				}
			}
			check(tokens.a);
			check(tokens.b);
			check(tokens.c);
			check(tokens.d);
			check(tokens.e);
			check(tokens.f);
			check(tokens.g);
			check(tokens.h);
			check(tokens.i);
			/*
			this._guesses[tokens.a] = data[tokens.a];
			this._guesses[tokens.b] = data[tokens.b];
			this._guesses[tokens.c] = data[tokens.c];
			this._guesses[tokens.d] = data[tokens.d];
			this._guesses[tokens.e] = data[tokens.e];
			this._guesses[tokens.f] = data[tokens.f];
			this._guesses[tokens.g] = data[tokens.g];
			this._guesses[tokens.h] = data[tokens.h];
			this._guesses[tokens.i] = data[tokens.i];
			*/
			if(this.getType != tileOBJ.types.set && this.getType != tileOBJ.types.locked) this.checkGuessState();
			return;
		}
		if(data !== true) data = false;
		this._guesses = [];
		this._guesses[tokens.a] = data;
		this._guesses[tokens.b] = data;
		this._guesses[tokens.c] = data;
		this._guesses[tokens.d] = data;
		this._guesses[tokens.e] = data;
		this._guesses[tokens.f] = data;
		this._guesses[tokens.g] = data;
		this._guesses[tokens.h] = data;
		this._guesses[tokens.i] = data;
		if(this.getType != tileOBJ.types.set && this.getType != tileOBJ.types.locked) this.checkGuessState();
	}
}



/**
 * Enum of Tile Types
 * @name Tile Types
 * @readonly
 * @prop {number} tileOBJ.types.blank 1
 * @prop {number} tileOBJ.types.set 2
 * @prop {number} tileOBJ.types.guess 3
 * @prop {number} tileOBJ.types.locked 4
 * @enum {number}
 * @see {@link tileOBJ#types}
 * @global
 */
/**
 * Enum of Tile Types
 * @prop {number} blank 1
 * @prop {number} set 2
 * @prop {number} guess 3
 * @prop {number} locked 4
 * @name tileOBJ.types
 * @readonly
 * @enum {number}
 */
tileOBJ.types = {
	blank: 1,
	set:2,
	guess:3,
	locked:4
}

module.exports = tileOBJ;