Hot answers tagged

28

The c6 knight is pinned by the bishop on b5. Note that if the c6 knight were to move it would leave Black's king in check, which renders any such move illegal. Therefore it is ok in this case to write "Ne7" instead of "Nge7", since the pin means that there is no ambiguity as to which knight moves.


16

You can use the SVG rendering functionalities of python-chess. This will allow you to create a SVG-formatted visualisation of any board position loaded using python-chess. FEN to SVG For example, given a FEN as input (say we save our python script as boardtosvg.py) Using python3 and the python-chess library version 0.30.1 import chess import chess.svg import ...


12

Best guess: the mistake occured before, on move 15 Entry errors are frequent when games are entered into a software, especially if they are not entered by one of the players. Here the operator must have made an error before move 19, reached an anomaly, and couldn't solve the mystery (or didn't have time to try, there are other games to be saved). In such ...


11

As of 2017.04.01, pgn-extract (version 17-38) does provide variation splitting functionality via its --splitvariants flag. So, if you want this in a Windows/Linux/Mac OS environment it is available. Disclosure: I am the author of pgn-extract.


11

From the specification: A basic SAN [Standard Algebraic Notation] move is given by listing the moving piece letter (omitted for pawns) followed by the destination square. Capture moves are denoted by the lower case letter "x" immediately prior to the destination square; pawn captures the file letter of the originating square of the capturing pawn ...


10

PyChess Is a chess client built in Python. You can use it's chess logic libraries without much trouble. http://code.google.com/p/pychess/source/browse/utilities/arena.py http://code.google.com/p/pychess/source/browse/utilities/blunders.py Are examples of how you you might use the libraries to control chess engines, but you can also use just the chess ...


9

Here is the author's page courtesy of archive.org. The zip file on that page includes the readme. Direct download of the zip file


9

PGN standards are described here. There are seven more-or-less required tags: [Event] [Site] [Date] [Round] [White] [Black] [Result] and many different supplemental tags, for example [WhiteElo] and [BlackElo] for the players' ratings, [Board] for the board number in team events, and [TimeControl] for information about the time-control used.


9

[Date "1910.01.07"] [Result "1/2-1/2"] [White "Carl Schlechter"] [Black "Emanuel Lasker"] 1. e4 {Notes by J. R. Capablanca} e5 {This is Black's second move!} 2. Nf3 Nc6 3. Bb5 Nf6 * This is a sample PGN game. You'll just need { and } to enclose your comments. But you should use a chess program to do it for you. SCID is free and can do it for you.


8

Would this be what you are looking for? PGN-extract (A command line utility) http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/ I can see a flag in the feature doc that might help: -W[cm|epd|halg|lalg|elalg|san|uci] - specify the output format to use -Whalg is hyphenated long algebraic. -Wlalg is long algebraic -Welalg[PNBRQK] is enhanced long ...


8

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 ...


8

While it's not ambiguous (only Nfe3 is legal), it is better to be specific with Nfe3. Successful software can deal with both Ne3 and Nfe3, but not every pgn parser is perfect, and some beginners will appreciate the additional guidance.


8

Notepad ++ with option Language->Pascal highlights headers, move numbers, actual moves and comments with different colors. Works exactly as I would expect.


8

There is an extension for Vim (a great editor) that provides syntax highlighting for PGN. You can download Vim here. You can find the extension here.


8

Yes, ChessBase does more than just support them, it definitely uses them. Since I got here, due to how I write notation, de instead of dxe4, for example, I used to have problems getting the FEN board here to work. Now, I have figured it out, but I still input my answer into a ChessBase board first, including annotations, and then Home>Copy Game, paste it ...


8

Yes, of course it's possible. I've done it a lot professionally. However, there is no tool that just takes a PGN chess game and convert it into images. You will need to do some programming, not very hard. Here is a link on how one can generate machine learning data set on chess. You should be able to reuse the code. I highlighted the part that will relate ...


7

Yes, there are two ways to add a text comment to a pgn file. The first is far more common: simply wrap the comment in {braces} 1. e4 {Best by test!} e5 The second is less common, but also a part of the official pgn spec1. An end of line comment is allowed if it is preceded by a semicolon 1. e4; Best by test! 1... e5 This is far more awkward to read ...


7

Yes there are easy ways to do this. I'm going to briefly show you one quick way of doing it in python, using the python-chess module. If the in-code comments are not enough, feel free to ask for clarifications or possible extensions of the code: To showcase a working example, I've taken a game between Adams and Kasparov, you can download the PGN from the ...


7

I happen to be the author of the chessboard editor under discussion. Let me clarify the issue. This editor is supposed to enforce legal moves but it has a bug which prevents it from being able to make a pawn capture onto the final rank. Therefore it cannot notice that a black chessman controls the f1 square. If you place a black bishop on the a6-f1 diagonal ...


6

Ne3 is perfectly fine, every normal pgn viewer knows legal moves and will perform it correctly.


6

There is a detailed standard of PGN available, for instance here: PGN standard at the Wayback Machine. You will never see "e4 e6 f4" in a PGN file, since it is mandatory to mention the move number before white's move: "1.e4 e6 2.f4".


6

In order, 1) Not to my knowledge 2) Not to my knowledge 3) There are several things that make this sort of project non-trivial, even difficult. Not the least of which is following the piece, differentiating it from a hand gesture, for example. Also determining when the move stopped would be an interesting question for computer vision to solve. These kinds ...


6

Lichess also uses them. When using the Study feature of Lichess, you can manually annotate a game with any of these symbols: If you then export your study or study chapter as a PGN file, it will include the annotations using NAG notation. Only the six traditional suffix annotations (!, ?, !!, ??, !?, ?!) are represented directly, without dollar signs, since ...


6

Python utilities for experimenting with Leela Chess Zero a neural network based chess engine: https://github.com/glinscott/leela-chess/ Here: https://github.com/so-much-meta/lczero_tools This allows you to run the network in Python on specific board positions via python-chess, and get policy/value outputs. (Works with pytorch, and is also able to run the ...


6

The FEN consists of six parts (see definition of FEN here): piece placement: at most 64 characters, one for each square plus 7 times "/" to delimit ranks = 71 characters active color: one character ("w" or "b") castling: at most 4 characters en passant: one or two characters half move clock full move number In addition there are 5 space characters between ...


5

That would be a rather complex task. Maybe a reasonable first step is to look into recognizing FEN position from a single image - for which more resources exists, for example: Create a FEN from a chess diagram picture Recommended pattern recognition technique for chess board


5

Chess engines normally don't read PGN. When they "start" they read a position that is encoded in a FEN notation. FEN is a powerful way to describe a chess position. From this position a sequence of moves can be given in a string. The most common way of communicating with a chess engine is via the UCI protocol: http://wbec-ridderkerk.nl/html/UCIProtocol.html ...


5

just found this: 8.2.3.4: Disambiguation Note that the above disambiguation is needed only to distinguish among moves of the same piece type to the same square; it is not used to distinguish among attacks of the same piece type to the same square. An example of this would be a position with two white knights, one on square c3 and one on ...


5

It's 2019-12 now and 5 years after the original question. Does any such thing exist (webcam/video to pgn converter)? A prototype maybe? see https://github.com/WolfgangFahl/play-chess-with-a-webcam/issues/19 https://github.com/WolfgangFahl/play-chess-with-a-webcam/issues/22 which are both closed by now. See http://lichess.bitplan.com for a game ...


Only top voted, non community-wiki answers of a minimum length are eligible