aboutsummaryrefslogtreecommitdiff
path: root/web/http/worker.mjs
blob: 575659805f0439a121ad97a0eaf2f2838a3b476d (plain)
1
2
3
4
5
6
7
8
9
10
11
import Nissy from "./nissy_web_module.mjs"

const nissy = await Nissy();
nissy.setLogger(nissy._addCallbackFunction(console.log));

onmessage = (e) => {
  var cube = new nissy.Cube();
  cube.move(e.data.scramble);
  nissy.solve(e.data.solver, cube, nissy.NissFlag.normal, 0, 17, 1, 99, 4, -1)
    .then((sol) => postMessage(sol))
};

Generated with cgit - Back to sebastiano.tronto.net