UNPKG

better-sudoku

Version:
34 lines (33 loc) 938 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Square = void 0; const constants_1 = require("../constants"); const utils_1 = require("../utils"); const INITIAL_COORDS = { row: 0, col: 0, }; class Square { constructor(row, col) { this.coords = INITIAL_COORDS; this.possibleNumbers = constants_1.INITIAL_POSSIBLE_NUMBERS; this.choosenNumber = 0; this.removeNumbersFromPossibilites = (numbersToRemove) => { this.possibleNumbers = (0, utils_1.arraysDiff)(this.possibleNumbers, numbersToRemove); }; this.coords = { row, col }; } get PossibleNumbers() { return [...this.possibleNumbers]; } get row() { return this.coords.row; } get column() { return this.coords.col; } get Coords() { return this.coords; } } exports.Square = Square;