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