Answers.Body: <p>From the PGN specification (<a href="http://www6.chessclub.com/help/PGN-spec" rel="noreferrer">http://www6.chessclub.com/help/PGN-spec</a>):</p>
  
  <blockquote>
    <p>Neither the appearance nor the absence of either a check or
    checkmating indicator is used for disambiguation purposes.  This means
    that if two (or more) pieces of the same type can move to the same
    square the differences in checking status of the moves does not
    allieviate the need for the standard rank and file disabiguation
    described above.  (Note that a difference in checking status for the
    above may occur only in the case of a discovered check.)</p>
  </blockquote>
  
  <p>This means you have to specify files respectively ranks in your two diagram examples.</p>
  
  <p>My understanding is that you need to disambiguate in the last two situations you describe as well. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-09-08T14:01:39.810Z
Answers.LastActivityDate: 2013-09-08T15:14:41.087Z
Answers.LastEditDate: 2013-09-08T15:14:41.087Z
Answers.UserDisplayName: Dag Oskar Madsen
Body: <p>I'm writing a PGN file parser, and need to know in which situations you don't need to write the rank/file of a piece that makes the move. I can think of the following:</p>
  
  <ul>
  <li><p>only one piece can conduct the move according to the rules of movement (i.e. attempting to move a bishop horizontally - that's obvious).</p></li>
  <li><p>both pieces can move to the given square, but all but one are obstructed by other pieces</p></li>
  <li><p>all but one of the pieces are pinned and moving them would expose the king to check</p></li>
  </ul>
  
  <p>Anything else I'm missing? </p>
  
  <p>I'd also like to add some seemingly ambiguous situations:</p>
  
  <p><img src="https://i.sstatic.net/GjWux.png" alt="Position #1"></p>
  
  <p>Black to move. Is Nc5+ valid PGN, or would it be Nbc5+? Is Nc5 valid, or would it be Nec5?</p>
  
  <p><img src="https://i.sstatic.net/AdiFG.png" alt="Position #2"></p>
  
  <p>Black to move. Is Rg7# / Rg7+ valid PGN, or do I need to specify the rank here?</p>
  
  <p>What if two pieces can move to the same square, but one of the moves would result in threefold repetition, and the game doesn't stop instantly?</p>
  
  <p>What if two pieces can move to the same square, one of those moves forces a mate-in-one on the moving side, and the move is labeled "!!"? :)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-10-17T17:55:33.323Z
Comments.Text: most of the things are answered in here http://chess.stackexchange.com/q/1817/478
Comments.UserDisplayName: ajax333221
Tags: <rules><notation><pgn>
Title: Parsing PGN files - when can a move be shortened?
ThreadText: # Parsing PGN files - when can a move be shortened?
  
  (Asked by: username_0 on 2013-09-04)
  
  I'm writing a PGN file parser, and need to know in which situations you don't need to write the rank/file of a piece that makes the move. I can think of the following:
  
  * only one piece can conduct the move according to the rules of movement (i.e. attempting to move a bishop horizontally - that's obvious).
  * both pieces can move to the given square, but all but one are obstructed by other pieces
  * all but one of the pieces are pinned and moving them would expose the king to check
  
  Anything else I'm missing?
  
  I'd also like to add some seemingly ambiguous situations:
  
  ![Position #1](https://i.sstatic.net/GjWux.png)
  
  Black to move. Is Nc5+ valid PGN, or would it be Nbc5+? Is Nc5 valid, or would it be Nec5?
  
  ![Position #2](https://i.sstatic.net/AdiFG.png)
  
  Black to move. Is Rg7# / Rg7+ valid PGN, or do I need to specify the rank here?
  
  What if two pieces can move to the same square, but one of the moves would result in threefold repetition, and the game doesn't stop instantly?
  
  What if two pieces can move to the same square, one of those moves forces a mate-in-one on the moving side, and the move is labeled "!!"? :)
  
  **Tags:** rules, notation, pgn
  
  > **Comments:**
  > **username_1**: most of the things are answered in here http://chess.stackexchange.com/q/1817/478  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2013-09-08. Score: 11 | Accepted answer
  
  From the PGN specification (<http://www6.chessclub.com/help/PGN-spec>):
  
  > Neither the appearance nor the absence of either a check or
  > checkmating indicator is used for disambiguation purposes. This means
  > that if two (or more) pieces of the same type can move to the same
  > square the differences in checking status of the moves does not
  > allieviate the need for the standard rank and file disabiguation
  > described above. (Note that a difference in checking status for the
  > above may occur only in the case of a discovered check.)
  
  This means you have to specify files respectively ranks in your two diagram examples.
  
  My understanding is that you need to disambiguate in the last two situations you describe as well.
  
  
  ---
  
  