pgn viewer source

Discussion of chess software programming and technical issues.

Moderator: Ras

Pierre Bokma
Posts: 31
Joined: Tue Dec 07, 2010 11:19 pm
Location: Holland

pgn viewer source

Post by Pierre Bokma »

hi

does any body know a place were i can find a source code to read pgn files?


thanks guys
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: pgn viewer source

Post by hgm »

Any GUI must contain such code, so you could rip it out of an open-source GUI (e.g. SCID, WinBoard). The code in WinBoard is not terribly compact, though. With parser.c and moves.c (and the included header files) you should have most of it, though. It was never designed as stand-alonecode, though, so you might have to do a lot of patching to cut it loose from the rest of the code.

Remember that parsing PGN needs an internal representation of the board, and the reason why any program would parse it probably also does,and the representation used by a program you take the code frommight not be very suited for what you need.
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: pgn viewer source

Post by Ron Murawski »

Pierre Bokma wrote:hi

does any body know a place were i can find a source code to read pgn files?


thanks guys

http://www.horizonchess.com/pmwiki.php? ... rogramming
'Source Code and Tools'
San Kit -- Chess library: Import/export PGN files, etc.

It's C source code written by Steven Edwards
nkg114mc
Posts: 74
Joined: Sat Dec 18, 2010 5:19 pm
Location: Tianjin, China
Full name: Chao M.

Re: pgn viewer source

Post by nkg114mc »

chessX may be a good choice for you!

See the database dir under the src.

It used Qt lib. So you should install Qt, and then all of the code was able to be compiled.

http://chessx.sourceforge.net/?q=node/3