Answers.Body: <p>Sorry I don’t know any JavaScript but here is the basic code (in pseudo code) for the problem:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>This is assuming there is a 2D array holding the board named “Board” and a string “Move” holding the move about to be played.</p>
  
  <p>Hope this has helped.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-21T20:43:15.660Z
Answers.LastActivityDate: 2018-05-22T01:06:51.883Z
Answers.LastEditDate: 2018-05-22T01:06:51.883Z
Answers.UserDisplayName: Arkleseisure
Body: <p>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.</p>
  
  <p>Answers such as the ones from the link below are not helpful. for example: the computer knows the names of the pieces.</p>
  
  <p><a href="https://chess.stackexchange.com/questions/18876/changing-uci-output-to-include-piece-names">Changing UCI output to include piece names</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-20T15:26:51.750Z
Comments.Text: You just need to use the JS library to keep a board state. Or use FEN to work out the pieces. My answer in the link is correct. Please note asking for JS code without some serious attempt is off topic here.
Comments.UserDisplayName: SmallChess
Tags: <engines><software><programming><notation>
Title: convert stockfish pv output to show piece names
ThreadText: # convert stockfish pv output to show piece names
  
  (Asked by: username_0 on 2018-05-20)
  
  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](https://chess.stackexchange.com/questions/18876/changing-uci-output-to-include-piece-names)
  
  **Tags:** engines, software, programming, notation
  
  > **Comments:**
  > **username_1**: You just need to use the JS library to keep a board state. Or use FEN to work out the pieces. My answer in the link is correct. Please note asking for JS code without some serious attempt is off topic here.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-05-21. Score: 0
  
  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 <== “N” + Move(3) + Move(4)
  CASE “P”
        Move <== Move(3) + Move(4)
  CASE “K”
        Move <==“K” +  Move(3) + Move(4)
  CASE “R”
        Move <==“R” +  Move(3) + Move(4)
  CASE “Q”
        Move <==“Q” +  Move(3) + Move(4)
  CASE “B”
        Move <==“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.
  
  
  ---
  
  