Compare commits

..

3 Commits

Author SHA1 Message Date
058dc13c1c Simplified selectColumnSizeHeuristic 2021-02-25 11:30:20 -07:00
18e468b17f Update Dockerfile 2021-02-25 11:30:20 -07:00
24d8ab6763 Update all imports to .js for esm support, use threads.js
threads.js has better support for modules - no need to give a
project-relative path to the worker file, which complicated the build.

Add rudimentary thread pooling w/ execution timeout.
2021-02-25 11:30:20 -07:00

View File

@ -5,12 +5,9 @@ const maths = {};
expose({ expose({
generate(regionWidth, regionHeight, clues) { generate(regionWidth, regionHeight, clues) {
const key = `${regionWidth}:${regionHeight}`;
const math = const math =
maths[`${regionWidth}:${regionHeight}`] || maths[key] ?? (maths[key] = new SudokuMath(regionWidth, regionHeight));
(maths[`${regionWidth}:${regionHeight}`] = new SudokuMath(
regionWidth,
regionHeight
));
return math.generate(clues); return math.generate(clues);
}, },
}); });