forked from ProjPossibility/AccessibleSudoku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtablefill.js
42 lines (36 loc) · 1.37 KB
/
tablefill.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var TableFill = namespace("AccessibleSudoku.TableFill");
TableFill.fillGrid = function()
{
Sudoku.loadNextBoard();
gridnum=board;
var i=0,j=0;
var row;
var col;
var idobject;
while(i<9)
{
j=0;
row=ChangeGrid.getRowCharacter(i);
while(j<9)
{
col=ChangeGrid.getColCharacter(j);
idobject=row + col;
//console.log("row: "+row+"col: "+col);
if(gridnum[i][j]==0)//if grid==0, then put blank
{
document.getElementById(idobject).innerHTML = " ";
}
else
{
var cellNode = document.getElementById(idobject);
cellNode.innerHTML = gridnum[i][j];
$(cellNode).addClass('filled');
// document.getElementById(cell).style.color = 'black';
}
j=j+1;
}
i=i+1;
}
MoveCell.color(cell,1);
$("#inputbox").focus();
}