Hot answers tagged

30

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.


20

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


17

What you're looking for is software/website that allows you to load or import PGN files. The Lichess Analysis board, for example, supports exactly what you want: https://lichess.org/analysis -- below the board is a text area labelled "PGN", paste your moves in there and hit "Import PGN", and you can then navigate through your game. All ...


12

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.


12

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


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

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


9

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


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.


9

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


9

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


8

There is no symbol for a draw offer. Just add a comment {draw offered}


8

PGN files are normal text files. You can generate it to somepoint using the software and then save the file, open it in a text editor (notepad, notepad++, ...) and continue editing there.


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


8

Yes, it's possible for a piece to need both the rank and file to distinguish it, although it's rare. For example: [FEN "8/1k6/8/8/5Q2/8/3Q1QK1/8 w - - 0 1"] 1.Qf2e3


7

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


7

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


7

@DM showed one possibility, which would also work with bishops (and on various other places on the board, with the three pieces at corners of a square). The only other option is with knights: [FEN "8/1k6/8/8/5N2/8/1N3NK1/8 w - - 0 1"] 1. Nf2d3


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

Stockfish is an engine that's called by apps that read PGN files, it doesn't read the PGN data itself. There are many very good free apps that can read PGN files and analyse the games they contain using Stockfish (which is also free) and/or similar engines (mostly not free) A lot of good free PGN reader apps that are able to call Stockfish can be ...


6

Good question. This nested notation (also called: recursive annotation variation, RAV for short) is uncommon but valid[*]. In the example you provide, most online PGN readers have no problem parsing and accounting for all the variations and subvariations. So the way to read it is as follows: the nested structure is composed of independent variations, only if ...


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

You can use the percent sign to comment out a line of text in your PGN file (similar to Latex). For example, if you'd like to include personal comments that categorize the games within the database, such as % Games to study later. All such lines starting with % will not be interpreted by a PGN parser, so you can safely leave self-notes or other comments (...


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


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

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

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


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