UNPKG

sudoku-solve

Version:

Konni's Sudoku solving library

24 lines (23 loc) 726 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Position = void 0; const CommonFunctions_1 = require("./CommonFunctions"); class Position { constructor(row, col, index) { this.row = row; this.col = col; this.index = index; } static fromRowCol(row, col) { return new Position(row, col, CommonFunctions_1.index(row, col)); } static fromIndex(row, col, index) { return new Position(CommonFunctions_1.row(index), CommonFunctions_1.col(index), index); } equals(other) { return this.row === other.row && this.col === other.col && this.index === other.index; } } exports.Position = Position;