Mark original numbers with grey background.
This commit is contained in:
@ -37,6 +37,9 @@
|
||||
r = Math.floor(i / this.dim2);
|
||||
c = i % this.dim2;
|
||||
this.board[r][c].setValue(boardString.charAt(i));
|
||||
if (boardString.charAt(i) !== '.') {
|
||||
this.board[r][c].setOriginal(true);
|
||||
}
|
||||
this.board[r][c].resetChangeFlag();
|
||||
}
|
||||
this.setCheckDiags(alsoCheckDiags);
|
||||
@ -83,6 +86,9 @@
|
||||
if (this.cellAt(r, c).hasChanged()) {
|
||||
cssclasses.push('changed');
|
||||
}
|
||||
if (this.cellAt(r, c).isOriginal()) {
|
||||
cssclasses.push('original');
|
||||
}
|
||||
value = this.cellAt(r, c).getValue();
|
||||
if (value === '.') {
|
||||
value = '';
|
||||
|
@ -4,6 +4,7 @@
|
||||
function SudokuCell(initVal, boardObj) {
|
||||
this.boardObj = boardObj;
|
||||
this.changed = false;
|
||||
this.original = false;
|
||||
this.value = 0;
|
||||
this.set = (1 << this.boardObj.dim2) - 1;
|
||||
this.setValue(initVal);
|
||||
@ -68,6 +69,14 @@
|
||||
return this.changed = false;
|
||||
};
|
||||
|
||||
SudokuCell.prototype.setOriginal = function(newValue) {
|
||||
return this.original = newValue;
|
||||
};
|
||||
|
||||
SudokuCell.prototype.isOriginal = function() {
|
||||
return this.original;
|
||||
};
|
||||
|
||||
return SudokuCell;
|
||||
|
||||
})();
|
||||
|
@ -295,8 +295,8 @@
|
||||
'twoValPlacesColumn': 'Only two possible places for pair in column.',
|
||||
'twoValPlacesDiag': 'Only two possible places for pair in diagonale.',
|
||||
'oneUnknownAll': 'Only one possible value left.',
|
||||
'oneColumnForValue': 'Only one possible column for value.',
|
||||
'oneRowForValue': 'Only one possible row for value.'
|
||||
'oneColumnForValue': 'Only one possible column in block for value.',
|
||||
'oneRowForValue': 'Only one possible row in block for value.'
|
||||
};
|
||||
i = 1;
|
||||
while (true) {
|
||||
|
Reference in New Issue
Block a user