aboutsummaryrefslogtreecommitdiff
path: root/web/http/worker.mjs
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-05-25 12:12:38 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-05-25 12:12:38 +0200
commit8dcdfd23ef6fedf89b8a485f6bb54974e5077881 (patch)
treee510a5bafbd9fc05b00c08a20daa8aa1247668db /web/http/worker.mjs
parent238702e7dd860af59d22f33cbfe163f28c3beb4e (diff)
downloadnissy-core-8dcdfd23ef6fedf89b8a485f6bb54974e5077881.tar.gz
nissy-core-8dcdfd23ef6fedf89b8a485f6bb54974e5077881.zip
Oops forgot to add these files
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