
class SudokuNumber extends CanvasObject {

    constructor(x, y, width, height, value = 0) {
        super(x, y, width, height);
        this.value = value;
        this.block = false;
        this.possibleValues = [1,2,3,4,5,6,7,8,9];
        this.userMark = [];
    }

    /**
     * Set new value
     * @param {Number} value New value
     * @return {SudokuNumber} Instance of this
     */
    setValue(value) {

        // Is blocked?
        if (this.block)
            return this;

        // Is valid?
        if (value < 0 || value > 9)
            throw new Error('Invalid number entry');

        if (this.value == value)
            value = 0;

        // Set value
        this.value = value;

        // Return class
        return this;
    }

    /**
     * Get the value of the number
     * @returns {SudokuNumber} Value of number
     */
    getValue() {

        return this.value;
    }

    setBlock(block) {

        this.block = block;

        return this;
    }

    isBlock() {

        return this.block;
    }

    setUserMark() {

    }

    draw(canvasCtx) {

        if (this.block)
            canvasCtx.fillStyle = "#666666";
        else
            canvasCtx.fillStyle = "#FFFFFF";

        canvasCtx.beginPath();

        canvasCtx.rect(this.x,this.y, this.width, this.height);
        
        canvasCtx.fill();

        canvasCtx.fillStyle = "#000000";
        canvasCtx.font= "30px Tahoma";
        canvasCtx.textAlign="center";
        canvasCtx.textBaseline="middle"; 

        if (this.value)
            canvasCtx.fillText(this.value,this.x+24,this.y+24);
    }
}
@@ -179,16 +179,50 @@
  false;%0A
+        this.isCollision = false;%0A
         
@@ -1120,32 +1120,111 @@
 Ctx) %7B%0A%0A        
+if(this.isCollision)%0A            canvasCtx.fillStyle = %22#d80404%22;%0A        else 
 if (this.block)%0A
@@ -1715,8 +1715,9 @@
 %0A    %7D%0A%7D
+%0A

Check for errors pt. 1