convert stockfish pv output to show piece names What are suggested coding snippets to add pieces to pure algebraic notation (this would change g1f3 to Nf3) when using the chess.js and chessboard.js (javascript) interface.  Stockfish uses this type of raw notation and I would like to change it.

Answers such as the ones from the link below are not helpful. for example: the computer knows the names of the pieces.

Changing UCI output to include piece names
Sorry I don’t know any JavaScript but here is the basic code (in pseudo code) for the problem:

SELECT CASE Board(Move(1),Move(2))
CASE “N”
      Move &lt;== “N” + Move(3) + Move(4)
CASE “P”
      Move &lt;== Move(3) + Move(4)
CASE “K”
      Move &lt;==“K” +  Move(3) + Move(4)
CASE “R”
      Move &lt;==“R” +  Move(3) + Move(4)
CASE “Q”
      Move &lt;==“Q” +  Move(3) + Move(4)
CASE “B”
      Move &lt;==“B” +  Move(3) + Move(4)
END SELECT


This is assuming there is a 2D array holding the board named “Board” and a string “Move” holding the move about to be played.

Hope this has helped.