Tool needed: pgn -> fen + final result

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Dann Corbit, Harvey Williamson

CRoberson
Posts: 2053
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Tool needed: pgn -> fen + final result

Post by CRoberson »

I know there are some pgn->fen tools, but to my knowledge none
put the game result at the end of each fen string.

If such doesn't exist, I could take some pgn->fen source and mod it.

Does anybody know of such a tool?
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Tool needed: pgn -> fen + final result

Post by Zach Wegner »

Hi Charles,

I don't know of such a tool, but if you end up modifying some source, ZCT can do stuff like this with just a tiny bit of code. Something like this:

Code: Select all

pgn_to_fens(BOARD *board, char *filename)
{
    int i, count;
    count = pgn_open(filename);
    for &#40;i = 0; i < count; i++)
        pgn_load&#40;board, i, fen_func, NULL&#41;;
&#125;

BOOL fen_func&#40;BOARD *board, void *arg, PGN_GAME *game&#41;
&#123;
    print&#40;"%F -c1 \"%s\"\n", board, game->tag.result&#41;;
&#125;