Return blank array when requested clues == 0
This commit is contained in:
parent
8526dcd083
commit
4e6cdab9ee
@ -158,6 +158,10 @@ export class SudokuMath {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generate(clues: number, attempts = Infinity, totalTime = Infinity) {
|
generate(clues: number, attempts = Infinity, totalTime = Infinity) {
|
||||||
|
if (clues === 0) {
|
||||||
|
return Array(this.values2).fill(0);
|
||||||
|
}
|
||||||
|
|
||||||
let [completed, updates] = this.generateComplete();
|
let [completed, updates] = this.generateComplete();
|
||||||
|
|
||||||
const [header, dlxRows] = this.getDLXHeader(); // complete header - no candidates removed
|
const [header, dlxRows] = this.getDLXHeader(); // complete header - no candidates removed
|
||||||
|
Loading…
Reference in New Issue
Block a user