joeldick / chess_puzzles2

0 stars 0 forks source link

Input promotion #1

Closed joeldick closed 2 months ago

joeldick commented 2 months ago

Let the board accept when the inputs piece promotion. First becomes an issue on Puzzle #19 (FEN: "6r1/2Q2P2/5k2/5P2/5K2/8/8/8 w - - 0 1").

image

joeldick commented 2 months ago

Works now. Based on docs at https://react-chessboard.vercel.app/?path=/docs/example-chessboard--premoves-enabled

const moveResult = game.move({
  from: sourceSquare,
  to: targetSquare,
  promotion: piece[1].toLowerCase() ?? "q",
});