1 // Logic to play a computer move in a web worker
2 onmessage
= async
function(e
) {
5 const vModule
= await
import("@/variants/" + e
.data
[1] + ".js");
6 self
.V
= vModule
.VariantRules
;
10 const fen
= e
.data
[1];
11 self
.vr
= new self
.V(fen
);
15 self
.vr
.play(e
.data
[1]);
18 const compMove
= self
.vr
.getComputerMove();
19 postMessage(compMove
);