Answers.Body: <p>Adding on to Brian Towers' answer, there is a quick way you can script this (assuming you are on Linux or another POSIX system with the <code>tr</code> command):</p>
  
  <pre><code>cat gamelog.txt | tr 'abcdefgh12345678' 'hgfedcba87654321' &gt; gamelog_reversed.txt
  </code></pre>
  
  <p>Edit: as @wimi said, this will mess up move numbers, so be careful about that. You may want to use <code>cut</code> and <code>paste</code> to seperate only the columns with the moves.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-27T07:18:26.373Z
Answers.Text: Just to play devil's advocate: this will mess up the move numbers...
Answers.UserDisplayName: wimi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-27T16:55:09.303Z
Answers.Text: Just to play dog's advocate: this is a [useless (use of) cat](https://en.m.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat).
Answers.UserDisplayName: YSC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-28T16:15:06.040Z
Answers.Text: @wimi edited to add a note.
Answers.UserDisplayName: vikarjramun
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T23:32:38.763Z
Answers.LastActivityDate: 2020-05-28T16:14:51.567Z
Answers.LastEditDate: 2020-05-28T16:14:51.567Z
Answers.UserDisplayName: vikarjramun
Answers.Body: <p>If you set the board up correctly, i.e. "white on the right and queen on her own colour", then you need to flip the letters like this:</p>
  
  <p>a &harr; h<br>
  b &harr; g<br>
  c &harr; f<br>
  d &harr; e<br>
  and the numbers like this:<br>
  1 &harr; 8<br>
  2 &harr; 7<br>
  3 &harr; 6<br>
  4 &harr; 5</p>
  
  <p>So, if white's first move was to push the pawn in front of the king 2 squares you will have written "d5" or "d7-d5". Using the look-up above change this to "e4" or "e2-e4". Do the same for black's first move. If white's second move was to move the knight nearest the king to the square two in front of the bishop and you have written "Nc6" use the look-up to change this to "Nf3". Work through all the moves changing them according to the look-up. </p>
  
  <p>If you are a programmer and the game is long it will probably be easier to write a simple program to do this.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T15:15:21.980Z
Answers.Text: I am a programmer, as it turns out.  I was hoping there would be a simple setting I could put in the PGN file header, similar to the [StartFlipped "1"] setting, to do this for me, but apparently not.
Answers.UserDisplayName: Haydentech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T18:30:58.220Z
Answers.Text: In the end, it was easier to do it by hand than try to program a solution.  It worked, and we now have a working PGN file.  Now to see all the blunders we made!
Answers.UserDisplayName: Haydentech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-28T00:46:41.157Z
Answers.Text: 2 relevant xkcd: [first one](https://xkcd.com/1205/) and [second one](https://xkcd.com/1319/)
Answers.UserDisplayName: pulsar512b
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T15:09:50.437Z
Answers.LastActivityDate: 2020-05-31T14:59:02.797Z
Answers.LastEditDate: 2020-05-31T14:59:02.797Z
Answers.UserDisplayName: Brian Towers
Body: <p>My son and I are rank chess amateurs, and we wanted to play our first "real" game where we keep track of moves to analyze later.  We started the game but then realized that the board was reversed (i.e. the black pieces were on rows 1 and 2).  Since we didn't notice until a few moves had been played, we just continued to use this reversed notation for the whole game.</p>
  
  <p>The resulting PGN file doesn't want to import into lichess.  Is there any way to take our "reversed" PGN game file and make it compatible?  Perhaps some automated way to reverse the notation, or alert the PGN importer that the notation is reversed so it can handle it?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-26T14:47:08.773Z
Comments.Text: How did you create the pgn file?
Comments.UserDisplayName: user1583209
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-26T14:48:48.037Z
Comments.Text: By hand, in a text editor
Comments.UserDisplayName: Haydentech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-26T15:30:24.827Z
Comments.Text: There is no automated way to do it because it's a really rare situation. People who type in PGN manually are usually experienced enough with chess to know the names of the squares without having to actually look at the board. You'll get there soon enough :-)
Comments.UserDisplayName: RemcoGerlich
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-27T12:11:13.357Z
Comments.Text: Fun question. I teach intro to programming using Python sometimes. I might turn this question into a homework assignment in the future (with an extra credit part involving truly clueless players who start with the board rotated 90 or 270 degrees rather than the 180 degrees that you had).
Comments.UserDisplayName: John Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-27T12:12:15.250Z
Comments.Text: It's ok, one day you'll look back and laugh when you see that PGN with an e5 opening. ;)
Comments.UserDisplayName: J...
Tags: <notation>
Title: How to correct reversed game notation?
ThreadText: # How to correct reversed game notation?
  
  (Asked by: username_0 on 2020-05-26)
  
  My son and I are rank chess amateurs, and we wanted to play our first "real" game where we keep track of moves to analyze later. We started the game but then realized that the board was reversed (i.e. the black pieces were on rows 1 and 2). Since we didn't notice until a few moves had been played, we just continued to use this reversed notation for the whole game.
  
  The resulting PGN file doesn't want to import into lichess. Is there any way to take our "reversed" PGN game file and make it compatible? Perhaps some automated way to reverse the notation, or alert the PGN importer that the notation is reversed so it can handle it?
  
  **Tags:** notation
  
  > **Comments:**
  > **username_1**: How did you create the pgn file?  
  > **username_0**: By hand, in a text editor  
  > **username_2**: There is no automated way to do it because it's a really rare situation. People who type in PGN manually are usually experienced enough with chess to know the names of the squares without having to actually look at the board. You'll get there soon enough :-)  
  > **username_3**: Fun question. I teach intro to programming using Python sometimes. I might turn this question into a homework assignment in the future (with an extra credit part involving truly clueless players who start with the board rotated 90 or 270 degrees rather than the 180 degrees that you had).  
  > **username_4**: It's ok, one day you'll look back and laugh when you see that PGN with an e5 opening. ;)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_8 on 2020-05-26. Score: 11 | Accepted answer
  
  If you set the board up correctly, i.e. "white on the right and queen on her own colour", then you need to flip the letters like this:
  
  a ↔ h  
  b ↔ g  
  c ↔ f  
  d ↔ e  
  and the numbers like this:  
  1 ↔ 8  
  2 ↔ 7  
  3 ↔ 6  
  4 ↔ 5
  
  So, if white's first move was to push the pawn in front of the king 2 squares you will have written "d5" or "d7-d5". Using the look-up above change this to "e4" or "e2-e4". Do the same for black's first move. If white's second move was to move the knight nearest the king to the square two in front of the bishop and you have written "Nc6" use the look-up to change this to "Nf3". Work through all the moves changing them according to the look-up.
  
  If you are a programmer and the game is long it will probably be easier to write a simple program to do this.
  
  > **Comments:**
  > **username_0**: I am a programmer, as it turns out.  I was hoping there would be a simple setting I could put in the PGN file header, similar to the [StartFlipped "1"] setting, to do this for me, but apparently not.  
  > **username_0**: In the end, it was easier to do it by hand than try to program a solution.  It worked, and we now have a working PGN file.  Now to see all the blunders we made!  
  > **username_9**: 2 relevant xkcd: [first one](https://xkcd.com/1205/) and [second one](https://xkcd.com/1319/)  
  
  ---
  
  ### Answer by username_5 on 2020-05-26. Score: 14
  
  Adding on to username_8 username_8' answer, there is a quick way you can script this (assuming you are on Linux or another POSIX system with the `tr` command):
  
  ```
  cat gamelog.txt | tr 'abcdefgh12345678' 'hgfedcba87654321' > gamelog_reversed.txt
  
  ```
  
  Edit: as @username_6 said, this will mess up move numbers, so be careful about that. You may want to use `cut` and `paste` to seperate only the columns with the moves.
  
  > **Comments:**
  > **username_6**: Just to play devil's advocate: this will mess up the move numbers...  
  > **username_7**: Just to play dog's advocate: this is a [useless (use of) cat](https://en.m.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat).  
  > **username_5**: @username_6 edited to add a note.  
  
  ---
  
  