bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] RE: Import formats


From: Jim Segrave
Subject: Re: [Bug-gnubg] RE: Import formats
Date: Thu, 22 Jun 2006 01:28:25 +0200
User-agent: Mutt/1.4.2.1i

On Wed 21 Jun 2006 (19:32 +0200), bekommt nüscht wrote:
> How can I import games in the following formats?
> 
> Game 1  
>   Player1 : 0  Player2 : 0  
> 1) 63: 24/21 13/7 63: 24/18* 13/10  
> 2) 65: 25/20 13/7* 65: 25/20 24/18*  
> 3) 54: 25/21 20/15* 51: 25/20 6/5  
> 4) 55: 13/8 8/3 8/3 6/1 51: 18/13 6/5  
> 5) 51: 24/23 15/10 61: 13/7 8/7  
> 6) 11: 23/22 22/21 10/9 9/8 32: 13/10 10/8  
> 7) 52: 6/1 6/4 21: 13/11 8/7  
> 8) 53: 21/16 16/13 53: 11/6 6/3  
> 9) 22: 13/11 13/11 8/6 6/4 43: 7/3 6/3  
> 10) 63: 13/7 7/4 33: 13/10 13/10 10/7 10/7  
> 11) 22: 11/9 11/9 9/7 9/7 65: 20/14 20/15  
> 12) 44: 7/3 7/3 6/2 6/2 54: 14/9 9/5  
> 13) 62: 8/2 3/1 41: 7/3 3/2  
> 14) 52: 8/3 3/1 Doubles => 2  
> 15) Takes 55: 15/10 8/3 8/3 7/2  
> 16) 62: 21/15* 3/1 42:  
> 17) 41: 21/17 2/1 21:  
> 18) Doubles => 4 Takes  
> 19) 62: 17/11 4/2 43:  
> 20) 11: 15/14 14/13 13/12 12/11 61: 25/19 5/4  
> 21) 66: 11/5 11/5 5/0 5/0 31: 19/16 7/6  
> 22) 53: 4/0 3/0 64: 16/10 10/6  
> 23) 43: 4/0 3/0 21: 7/6 2/0  
> 24) 61: 2/0 1/0 65: 6/0 5/0 

Well it's almost a Jellyfish .mat file, but gnubg is looking for the
following features:

Blank lines are ignored

Lines beginning with a hash mark '#' or a semi-colon ';' are comments
and are ignored.

gnubg then skips over lines until it finds one which looks like:

x point match

where x is a number (0 for money games), 'point' and 'match' can be
capitlised or all in lower case. If it doesn't find such a line, gnubg
reports it's not a .mat file.

Your sample file does not have such a line, adding at the top:

0 point match 

gets a bit further.

It then begins looking for games withing the match or session. It must
find a line beginning ' Game ', followed by a number. Note that there
must be a space before the word Game, it must appear with a capital
'G", there must be a valid number afterwards. Your file does not have
a space before the word Game.

It then looks for the player names and score lines. It must find a
line with two names, optionally with leading and trailing white space,
with each name being followed by a ':' and a number. I think that you
could crash gnubg by having a line beginning with a colon, this is a
minor bug. Your file meets this requirement.

gnubg then looks for move records, where a move record is a non-blank
line, optionally starting with a move number follwed by a left
parenthesis,

The line must either have two dice rolls 'nn:' where nn are the
numbers rolled 
   or
a move (either roll or cube action), then, starting at least 15
characters into the line, two or more spaces, followed by the
opponent's move.
The cube actions in your file do not meet this requirement.

You can make this file loadable by 

 Adding a line 
0 point match
  at the top

Putting a space before the word 'Game'

Makeing sure that on every line where there aren't two dice rolls,
that the second players move starts after column 15 and has at least
two spaces before it.

This, for example is sufficient:

==================================
0 point match

 Game 1  
  Player1 : 0  Player2 : 0 
1) 63: 24/21 13/7 63: 24/18* 13/10 
2) 65: 25/20 13/7* 65: 25/20 24/18* 
3) 54: 25/21 20/15* 51: 25/20 6/5 
4) 55: 13/8 8/3 8/3 6/1 51: 18/13 6/5 
5) 51: 24/23 15/10 61: 13/7 8/7 
6) 11: 23/22 22/21 10/9 9/8 32: 13/10 10/8 
7) 52: 6/1 6/4 21: 13/11 8/7 
8) 53: 21/16 16/13 53: 11/6 6/3 
9) 22: 13/11 13/11 8/6 6/4 43: 7/3 6/3 
10) 63: 13/7 7/4 33: 13/10 13/10 10/7 10/7 
11) 22: 11/9 11/9 9/7 9/7 65: 20/14 20/15 
12) 44: 7/3 7/3 6/2 6/2 54: 14/9 9/5 
13) 62: 8/2 3/1 41: 7/3 3/2 
14) 52: 8/3 3/1  Doubles => 2 
15) Takes        55: 15/10 8/3 8/3 7/2 
16) 62: 21/15* 3/1 42: 
17) 41: 21/17 2/1 21: 
18) Doubles => 4  Takes 
19) 62: 17/11 4/2 43: 
20) 11: 15/14 14/13 13/12 12/11 61: 25/19 5/4 
21) 66: 11/5 11/5 5/0 5/0 31: 19/16 7/6 
22) 53: 4/0 3/0 64: 16/10 10/6 
23) 43: 4/0 3/0 21: 7/6 2/0 
24) 61: 2/0 1/0 65: 6/0 5/0 
===================================

-- 
Jim Segrave           address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]