[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnubg] FIBS oldmoves import
From: |
Holger |
Subject: |
Re: [Bug-gnubg] FIBS oldmoves import |
Date: |
Tue, 04 Nov 2003 01:03:45 +0100 |
At 09:17 31.10.2003, Joern Thyssen wrote:
On Thu, Oct 30, 2003 at 11:25:46PM +0100, Jim Segrave wrote
> On Wed 29 Oct 2003 (14:49 -0700), West, Robert wrote:
> > Snowie ignores all the extra text and extracts just the FIBS toggle
> > moves information. I'm not why gnubg can't do the same thing.
> > Snowie can also pull multiple matches out of the same text file.
> >
> > Here is an example game mixed in with the usual FIBS garbage....I
> > can load this directly into Snowie using IMPORT FIBS toggle moves
> > option.
> >
> > It would be extremely useful to get gnubg to do this, as it should
> > not be client dependent and telnet output is as vanilla as it gets.
>
> Is there a spec anywhere describing all the valid lines a game might
> produce (to allow writing a parser which can discard the non-game
> material)?
gnubg should be able to read such a file. It'll only read the first
match, though.
gnubg is searching for
" %31s is X - %31s is O\n"
which is the place where the oldmoves log start.
It should ignore all other text in the log.
Biggles send me directly on FIBS a match log which didn't work because of
wrong line wrapping (and a missing newline).
The problem were these lines:
You win the game and get 2 points. Congratulations!Score is 0-0 in a 7
point mat
ch.
cht is X - Biggles_two is O
Which should read:
You win the game and get 2 points. Congratulations!
Score is 0-0 in a 7 point match.
cht is X - Biggles_two is O
After this small change I was able to import the match.
The relevant code from import.c is this:
while( 1 ) {
if( ( n = fscanf( pf, "Score is %d-%d in a %d", &n0, &n1,
&nLength ) ) == EOF ) {
outputerrf( _("%s: not a valid oldmoves file"), szFilename );
return -1;
I suppose there's no easy way to make it robust against newlines in between
the line.
Regards,
Holger
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Bug-gnubg] FIBS oldmoves import,
Holger <=