stockfish.js icon indicating copy to clipboard operation
stockfish.js copied to clipboard

What am I doing wrong with moving a piece?

Open JemiloII opened this issue 5 years ago • 2 comments

So we have position.

/* Note: */s.send = s.postMessage;

So I've created a new game already and did the startpos.

s.send(`position startpos moves e2e4`);
s.send(`go depth 15`);

returns e2e4...

Trying to get it to move so when I call go again. It thinks of a new move so I can then do something like:

s.send(`position ${chess.fen()} moves e7e6`);

JemiloII avatar May 10 '19 20:05 JemiloII

use this:

s.send(`position fen ${chess.fen()}`);

ms6rb avatar May 23 '20 01:05 ms6rb

fen should be the starting position fen. You can use startpos for short.

s.send(`position startpos moves e2e4 e7e6`);

moves just keeps getting longer as the game progresses.

You can send the current fen, like ms6rb said. However, doing so will make three-fold repetition impossible for the engine to calculate, so you should avoid that whenever possible.

nmrugg avatar May 23 '20 02:05 nmrugg