function KakuroProblem(width, height) {
    this.height = height;
    this.width = width;
    this.clue = [];
    for (var y = 0; y < height; ++y) {
        var line = [];
        for (var x = 0; x < width; ++x) {
            line.push({
                cellType: KakuroProblem.CELL_BLANK,
                clueHorizontal: 0,
                clueVertical: 0
            });
        }
        this.clue.push(line);
    }
}
KakuroProblem.CELL_CLUE = 0;
KakuroProblem.CELL_BLANK = 1;
KakuroProblem.prototype.getHeight = function () {
    return this.height;
}
KakuroProblem.prototype.getWidth = function () {
    return this.width;
}
KakuroProblem.prototype.isClue = function (x, y) {
    return this.clue[y][x].cellType == KakuroProblem.CELL_CLUE;
}
KakuroProblem.prototype.getClueHorizontal = function (x, y) {
    return this.clue[y][x].clueHorizontal;
}
KakuroProblem.prototype.getClueVertical = function (x, y) {
    return this.clue[y][x].clueVertical;
}
KakuroProblem.prototype.setClueHorizontal = function (x, y, v) {
    this.clue[y][x].clueHorizontal = v;
}
KakuroProblem.prototype.setClueVertical = function (x, y, v) {
    this.clue[y][x].clueVertical = v;
}

@@ -1057,110 +1057,554 @@
     
-this.clue%5By%5D%5Bx%5D.clueHorizontal = v;%0D%0A%7D%0D%0AKakuroProblem.prototype.setClueVertical = function (x, y, v) %7B
+if (this.clue%5By%5D%5Bx%5D.cellType == KakuroProblem.CELL_BLANK) %7B%0D%0A        this.clue%5By%5D%5Bx%5D = %7B%0D%0A            cellType: KakuroProblem.CELL_CLUE,%0D%0A            clueHorizontal: 0,%0D%0A            clueVertical: 0%0D%0A        %7D;%0D%0A    %7D%0D%0A    this.clue%5By%5D%5Bx%5D.clueHorizontal = v;%0D%0A%7D%0D%0AKakuroProblem.prototype.setClueVertical = function (x, y, v) %7B%0D%0A    if (this.clue%5By%5D%5Bx%5D.cellType == KakuroProblem.CELL_BLANK) %7B%0D%0A        this.clue%5By%5D%5Bx%5D = %7B%0D%0A            cellType: KakuroProblem.CELL_CLUE,%0D%0A            clueHorizontal: 0,%0D%0A            clueVertical: 0%0D%0A        %7D;%0D%0A    %7D
 %0D%0A  

set the cell to clue mode in setClue in KakuroProblem