fixed bug in checkColPlacement method. was causing additional incorrect column values to be added to each columns value array
This commit is contained in:
@@ -47,19 +47,23 @@ class SudokuSolver {
|
||||
|
||||
const columnKeys = Object.keys(columns);
|
||||
|
||||
columnKeys.forEach((n, i) => {
|
||||
columnKeys.forEach((key, i) => {
|
||||
|
||||
columnKeys.forEach((key, j) => {
|
||||
let values = []
|
||||
|
||||
columnKeys.forEach((n, j) => {
|
||||
|
||||
const start = j + (9 * i)
|
||||
const end = start + 1;
|
||||
|
||||
const columnValue = puzzleString.slice(start, end);
|
||||
|
||||
columns[key].push(columnValue);
|
||||
values.push(columnValue);
|
||||
|
||||
});
|
||||
|
||||
columns[key] = values;
|
||||
|
||||
});
|
||||
|
||||
// get column values for placement
|
||||
|
||||
Reference in New Issue
Block a user