fixed bug in checkColPlacement method. was causing additional incorrect column values to be added to each columns value array

This commit is contained in:
StevanFreeborn
2022-05-27 10:15:28 -05:00
parent 65b4154beb
commit 49fb66463a
+7 -3
View File
@@ -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