Wanted: Programmer for a small EPD tool...

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Glarean
Posts: 169
Joined: Sun Oct 05, 2008 11:04 am
Contact:

Wanted: Programmer for a small EPD tool...

Post by Glarean » Mon Apr 29, 2019 7:36 am

Is a programmer reading here who might have the desire and time to write a small freeware tool for converting PGN to EPD files?

It means: You load one (or more) PGN-file(s), which are converted into EPD-Txt-files, so that strings are generated:

rn1qr1k1/1p2bppp/p3p3/3pP3/P2P1B2/2RB1Q1P/1P3PP1/R5K1 w - - bm bxh7;
r1br2k1/ppp2q1p/nb3p2/6p1/2PN1B2/2P2B2/P1Q2PPP/3RR1K1 w - g6 bm nc6;

(etc.)

No console letter stuff please - that already exists:
https://www.remi-coulom.fr/ (pgn2epd)... -
... but a small Windows interface would be nice.

Desirable options:
- Output filter only for the black or white moves
- Output filter for best. move numbers (e.g. moves no. 20-35)
- Output filter for every 2nd move of white or black

More info about EPD
https://www.chessprogramming.org/Extend ... escription

Greetings: Walter

.

jefk
Posts: 394
Joined: Sun Jul 25, 2010 8:07 pm
Location: the Netherlands
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by jefk » Mon Apr 29, 2019 6:13 pm

it already exists (although not with all the options you want),
namely an old (and free) version of bookbuilder (bb36c)
which you can download (as part of a package with a newer bb) here:

[b]http://superchess.blogspot.com/[/b]

Nb the latest bb43 (with opening names and crafty analysis)
is a one week trial version, but the included bb36c will
continue to work after one week (!).

As for the additional options you desire, would be a nice
exercise (maybe) for a programmer (and amateur chess player) i
know from years ago in my chess club in The Hague/NL (DD).

Some (3 or 4 or so) years ago i sent him the source code(s)
but then contact diminished, don't know if he's still interested,
he nowadays is into more serious chess study, but still works in daylight
as a programmer i think (pm me, and i'll give you his name, and
possibly email address, have to dig into some history for the latter).

best regards
jef
jefk

jefk
Posts: 394
Joined: Sun Jul 25, 2010 8:07 pm
Location: the Netherlands
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by jefk » Mon Apr 29, 2019 6:43 pm

in addition, i'm also willing to send the sources to another
(chess) programmer provided he/she's willing to look at it
seriously and use the (freely availabe) Borland C++ builder (BCB) 1.
package with which it was made (in other words, going 'open source').

NB the later version Bb43 is more advanced, but made with
BCB6 (nowadays Embarcadero); unfortunately the later
version of BCb (Embarcadero) didn't have sufficient backwards
compatibility so i didn't upgrade (eg to Emb studio or whatever).
Nevertheless, also for Bb43, if a (chess, C++) programmer is
seriously interested, i can provide the source codes;
the idea was to incorporate some old features of Bb36c (full
minimax) to Bb43(*) which had not (yet) been transferred);
thx to Bas Hamstra (but no thx for his undecipherable chessbrd code)

Then Bb36c would become redundant and Bb43 would become
an interesting tool for further development (especially
after some debugging, possibly upgrading to Emb studio)
and with a UCI interface, and ideally some Gm database
to combine statistics and (end)node pv score. no intention
to compete with Aquarium, but this hobby brought me
to CCM (fide/iccf master) title already and the old and awesome
bb36c tool is still the fastest minimax tool in the world (i sometimes
use it to minimax a positional base with 21 million positions
and it still works (within 1 hr or so), despite some slight transposition
bugs as result of sometimes strange moves (eg Ng1f3 e5 Nf3g1 ?)

jef

(*) Within Bb43 there's (sometimes advanced) code by more
(chess) programmers as Michel Langeveld (brother of .. RL !?
yes i presume), Tony Werten (now also into correspondence
chess just like me), and a Hungarian whiz kid Ferenz(who had
been paid a little) and his girlfriend and yours truly for some more
awesome graphics. Compared with Chessbase by chessbase,
the Bb program is far better in indicating opening names/
variations, (taking into account transpositions) believe it or not.
Some small sales of Bb paid back the costs of Ferenz and personallly i
would find it a pity if this project -with possibly some educational
chess values (besides all the fritz brouhaha) would be discontinued
(i'm now 64, pensioned and no commercial interests anymore but
still available for a normal transition to first another programmer
then possibly another owner; in other words not a give away,
but available for a take-over by someone with sufficient
credentials and motivation, not to compete with chessbase,
not even with bookup, but possibly filling in some gaps which
are still there in the chess resources, eg in gambit playing style etc)

PS from such work i was boldly enough some years ago to claim
chess is a draw (even alphazero would not contradict this, i'm sure).
Nevertheless correspondence chess is still interesting because
of chess strategy (and latest developments by alfa0 and leela)
and personally i find the combination of computer chess
and own understanding (my latest otb tourn rating was
1840 or so) still interesting.
jefk

Glarean
Posts: 169
Joined: Sun Oct 05, 2008 11:04 am
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by Glarean » Mon Apr 29, 2019 7:47 pm

Many thx for the hint.

Walter

chrisw
Posts: 2292
Joined: Tue Apr 03, 2012 2:28 pm

Re: Wanted: Programmer for a small EPD tool...

Post by chrisw » Mon Apr 29, 2019 9:02 pm

Glarean wrote:
Mon Apr 29, 2019 7:36 am
Is a programmer reading here who might have the desire and time to write a small freeware tool for converting PGN to EPD files?

It means: You load one (or more) PGN-file(s), which are converted into EPD-Txt-files, so that strings are generated:

rn1qr1k1/1p2bppp/p3p3/3pP3/P2P1B2/2RB1Q1P/1P3PP1/R5K1 w - - bm bxh7;
r1br2k1/ppp2q1p/nb3p2/6p1/2PN1B2/2P2B2/P1Q2PPP/3RR1K1 w - g6 bm nc6;


code not checked, but should work, even kills doubkes and shuffles the epds ....

Code: Select all

 
def commented_pgn_datafiles_to_commented_fenfile(rootdir):
    import chess
    from random import shuffle
    print('PGN files to EPD conversion')
    pgn_file_list = ['a1', 'a2', 'a3']  # list of databases of pgns

    fen_list = []
    for pgn_file in pgn_file_list:
        fname_pgn = rootdir + "PGN-databases/" + pgn_file + ".pgn"
        file = pathlib.Path(fname_pgn)
        if not file.exists():
            print('bad filename or done PGN file series')
            break
        print('Using database', fname_pgn)
        pgn = open(fname_pgn)
        while (True):
            game = chess.pgn.read_game(pgn)
            if (game == None):
                break
            board = game.board()
            moveno = 0
            for node in game.mainline():
                move = node.move
                comment = node.comment
                board.push(move)
                fen = board.fen()             
                if (moveno > 0):
                    prior = prior + '; bm ' + move.uci()
                    fen_list.append(prior)
                prior = fen
                prior_comment = comment
                moveno += 1
        pgn.close()
    # here with all PGNs read and epd_list full of fens
    # remove doubles
    s9 = len(fen_list)
    print('fen count=', s9)
    fen_list = list(set(fen_list))
    print('after removing', s9-len(fen_list), 'duplicates, fen count=', len(fen_list))
    # shuffle
    print('shuffling fens ...')
    shuffle(fen_list)
    s9 = len(fen_list)
    # save fens .....
    f9 = len(fen_list)
    save_EPD_filename = rootdir + 'EPD-data/fens.epd'
    print('saving', f9, 'fens to', save_EPD_filename)
    fen_file = open(save_EPD_filename, 'w+', encoding='utf-8')
    for fen in fen_file:
        fen_file.write(fen + '\n')  # never can remember if '\n' needed or not
    fen_file.close()
    return
 
(etc.)

No console letter stuff please - that already exists:
https://www.remi-coulom.fr/ (pgn2epd)... -
... but a small Windows interface would be nice.

Desirable options:
- Output filter only for the black or white moves
- Output filter for best. move numbers (e.g. moves no. 20-35)
- Output filter for every 2nd move of white or black

More info about EPD
https://www.chessprogramming.org/Extend ... escription

Greetings: Walter

.

Ferdy
Posts: 4152
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Wanted: Programmer for a small EPD tool...

Post by Ferdy » Tue Apr 30, 2019 6:56 am

Glarean wrote:
Mon Apr 29, 2019 7:36 am
Is a programmer reading here who might have the desire and time to write a small freeware tool for converting PGN to EPD files?

It means: You load one (or more) PGN-file(s), which are converted into EPD-Txt-files, so that strings are generated:

rn1qr1k1/1p2bppp/p3p3/3pP3/P2P1B2/2RB1Q1P/1P3PP1/R5K1 w - - bm bxh7;
r1br2k1/ppp2q1p/nb3p2/6p1/2PN1B2/2P2B2/P1Q2PPP/3RR1K1 w - g6 bm nc6;

(etc.)

No console letter stuff please - that already exists:
https://www.remi-coulom.fr/ (pgn2epd)... -
... but a small Windows interface would be nice.

Desirable options:
- Output filter only for the black or white moves
- Output filter for best. move numbers (e.g. moves no. 20-35)
- Output filter for every 2nd move of white or black

More info about EPD
https://www.chessprogramming.org/Extend ... escription

Greetings: Walter

.
Preliminary draft of the GUI.

Image
Image edited.

You may suggest other features.
Last edited by Ferdy on Tue Apr 30, 2019 7:24 am, edited 1 time in total.

Dann Corbit
Posts: 10242
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by Dann Corbit » Tue Apr 30, 2019 7:06 am

Append as pm. It came fit if you strip off "append as" from the others after the first
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Glarean
Posts: 169
Joined: Sun Oct 05, 2008 11:04 am
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by Glarean » Tue Apr 30, 2019 7:28 am

Ferdy wrote:
Tue Apr 30, 2019 6:56 am
Preliminary draft of the GUI.
Image
Image edited.
You may suggest other features.
Oh, great job! I am looking forward to the final result. :-)
- It's possible to work on several games?
- This filter would still be desirable: Only every 2nd move of the game(s) will be converted to EPD.

Many thanks for your work!

Walter

.

Ferdy
Posts: 4152
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Wanted: Programmer for a small EPD tool...

Post by Ferdy » Tue Apr 30, 2019 7:40 am

Glarean wrote:
Tue Apr 30, 2019 7:28 am
- This filter would still be desirable: Only every 2nd move of the game(s) will be converted to EPD.
A game has two 2nd move, for white and for black. If you want to save white and black, just check the white and black checkbox and then modify the move number min and max.

Image

Glarean
Posts: 169
Joined: Sun Oct 05, 2008 11:04 am
Contact:

Re: Wanted: Programmer for a small EPD tool...

Post by Glarean » Tue Apr 30, 2019 7:57 am

Ah... - great!
And can you also filter the EPD so that only the two opponents are visible, or e.g. only the name of the black or the white one? Or just the tournament name?
e.g:
r1bqk1r1/1p1p1p1n2/p1n2pN1/2p1b2Q/2P1Pp2/1PN5/PB4PP/R4RK1 w q - - bm Rxf4; id "ERET 001 - Entlastung";

.

Post Reply