Page 1 of 1

PGN to FEN

Posted: Tue Mar 03, 2015 2:26 pm
by lbabboni
Hi!

First of all thanks! First chess forum I could sigin in 3 days... all others keep me waiting never arrived confirmation mail :D

I´m trying to do an evaluation function not knowing to programming more than in QBasic!! :oops: and I need to convert PGN files, that yo could find anywhere, into fen files that my function could read.
It seems pgn2fen could be usefull but do not save the last position!
Then googling I could download netchess but in the folder I unzip I just found the code, no the .exe and, of course, I failed to compile it :oops:

Could actually netchess convert PGN to FEN files as I understood?
How to get a netchess exe?

Sorry for my ignorance and bad english.

Thanks for any help and regards from Argentina :D

Re: PGN to FEN

Posted: Tue Mar 03, 2015 2:47 pm
by lbabboni
Eureka!! I found the exe here: :D
http://www.netintellgames.com/chess.htm?from_chess !!!

Here:
http://sourceforge.net/projects/avmnetchess/

I read this:
NetChess is a Graphical User Interface (GUI) for playing chess game. This software can be used
To play chess between two players over network using TCP/IP (LAN) or in internet/intranet (Network vs Network)
...
As PGN, FEN, EPD converter. This can be used
To convert PGN to FEN or EPD format...

...
As PGN, FEN or EPD gave viewer. Load multiple games....
...


I´m interesting in the bolded sentence but still can´t understood how to do it.... where to find the help, F1 do not work.

more presicely:
I need to convert a PGN file (entire one game) into fen strings (each per each position) it is: if the game had 40 moves, the PGN is just one file (7 as data and the 40 moves), but I need 40 lines with one postion aftere one position.
Somethinglike this:

PGN file:

[Event "Earl tourn"]
[Site "?"]
[Date "1906.??.??"]
[Round "?"]
[White "Giese"]
[Black "Alekhine, Alexander"]
[Result "0-1"]
[WhiteElo ""]
[BlackElo ""]
[ECO "C47"]

1.e4 e5 2.Nf3 Nc6 3.d4 exd4 4.Nxd4 Nf6 5.Nc3 Bb4 6.Nxc6 bxc6 7.Qd4 Qe7 8.f3 d5
9.Bg5 O-O 10.O-O-O Bc5 11.Bxf6 gxf6 12.Qa4 Be3+ 13.Kb1 d4 14.Ne2 c5 15.Nc1 Be6
16.Bc4 Rfb8 17.Nd3 Rb6 0-1


Corresponding fen file (where if you pay atention, the position after last move do not appear that is the bug I found in pgn2fen program that is what I used to made this fen string file:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
rnbqkbnr/pppp1ppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3
r1bqkbnr/pppp1ppp/2n5/4p3/3PP3/5N2/PPP2PPP/RNBQKB1R b KQkq - 0 3
r1bqkbnr/pppp1ppp/2n5/8/3pP3/5N2/PPP2PPP/RNBQKB1R w KQkq - 0 4
r1bqkbnr/pppp1ppp/2n5/8/3NP3/8/PPP2PPP/RNBQKB1R b KQkq - 0 4
r1bqkb1r/pppp1ppp/2n2n2/8/3NP3/8/PPP2PPP/RNBQKB1R w KQkq - 1 5
r1bqkb1r/pppp1ppp/2n2n2/8/3NP3/2N5/PPP2PPP/R1BQKB1R b KQkq - 2 5
r1bqk2r/pppp1ppp/2n2n2/8/1b1NP3/2N5/PPP2PPP/R1BQKB1R w KQkq - 3 6
r1bqk2r/pppp1ppp/2N2n2/8/1b2P3/2N5/PPP2PPP/R1BQKB1R b KQkq - 0 6
r1bqk2r/p1pp1ppp/2p2n2/8/1b2P3/2N5/PPP2PPP/R1BQKB1R w KQkq - 0 7
r1bqk2r/p1pp1ppp/2p2n2/8/1b1QP3/2N5/PPP2PPP/R1B1KB1R b KQkq - 1 7
r1b1k2r/p1ppqppp/2p2n2/8/1b1QP3/2N5/PPP2PPP/R1B1KB1R w KQkq - 2 8
r1b1k2r/p1ppqppp/2p2n2/8/1b1QP3/2N2P2/PPP3PP/R1B1KB1R b KQkq - 0 8
r1b1k2r/p1p1qppp/2p2n2/3p4/1b1QP3/2N2P2/PPP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