aboutsummaryrefslogtreecommitdiff
path: root/web/http/worker.mjs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--web/http/worker.mjs11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/http/worker.mjs b/web/http/worker.mjs
new file mode 100644
index 0000000..5756598
--- /dev/null
+++ b/web/http/worker.mjs
@@ -0,0 +1,11 @@
1import Nissy from "./nissy_web_module.mjs"
2
3const nissy = await Nissy();
4nissy.setLogger(nissy._addCallbackFunction(console.log));
5
6onmessage = (e) => {
7 var cube = new nissy.Cube();
8 cube.move(e.data.scramble);
9 nissy.solve(e.data.solver, cube, nissy.NissFlag.normal, 0, 17, 1, 99, 4, -1)
10 .then((sol) => postMessage(sol))
11};

Generated with cgit - Back to sebastiano.tronto.net