Tool needed: pgn -> fen + final result

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

Moderator: Ras

CRoberson
Posts: 2095
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 (i = 0; i < count; i++)
        pgn_load(board, i, fen_func, NULL);
}

BOOL fen_func(BOARD *board, void *arg, PGN_GAME *game)
{
    print("%F -c1 \"%s\"\n", board, game->tag.result);
}