class Nikoli.Sudoku extends Nikoli.Game constructor: (@board, @name = 'sudoku') -> super @board, @name errors: -> solution = @toArray() errors = [] for i in [0..8] square = [] column = [] row = solution[i] for j in [0..8] column.push(solution[j][i]) square.push(solution[(Math.floor(i/3)*3) + Math.floor(j/3)][(i%3*3) + (j%3)]) console.log square console.log column ### # check square [i%3*3][j/3*3] # check row [i][.] # check column [.][i] ### errors generate: (game, solution = false) -> @game = game if game? @grid.innerHTML = @game.map((row) -> '