BBO Discussion Forums: Text notation for deal diagram - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Text notation for deal diagram What is easiest to write/read?

#1 User is offline   Kungsgeten 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 947
  • Joined: 2012-April-15
  • Gender:Male

Posted 2013-October-25, 10:19

Hi!

I'm working on a way to write bridge system notes in text format, which then can be converted into nice looking PDF documents or HTML pages (and even the BBO full disclosure format, bu then only the bidding sequences). If you're interested, you can check it out at https://github.com/kungsgeten/bml .

I'm planning to add functionality to add deal diagrams. My hope is that it should be easy to both write and read these diagrams. The most obvious solution would be something like this:

Dealer:North
Vul:EW
       Kxx
       T9
       xxx
       Q987x
QT           Jxx
KQxxxx       Jxx
KTx          AJxx
Jx           KTx
       A987x
       Ax
       Q9x
       Axx


This is easy to read, since it looks like a normal deal diagram. The problem is that it takes time to write. There's a lot of whitespace going on.

PBN uses this notation:

N:K62.T9.542.Q9874 J53.J85.AJ86.KT5 A9874.A3.Q93.A63 QT.KQ7642.KT7.J2


This is hard to read, and pretty hard to write too. I guess it is better suited as a data storage format. LIN-files uses something similar.

One could use the PBN-style, but separate the hands on different rows (and indicate which player holds each hand):

Dealer:North
Vul:EW
N:K62.T9.542.Q9874
E:J53.J85.AJ86.KT5
S:A9874.A3.Q93.A63
W:QT.KQ7642.KT7.J2


Its some sort of middleway I guess. The suits could also be separated on different lines:

Dealer:North
Vul:EW
North
  Kxx
  T9
  xxx
  Q987x
West
  QT
  KQxxxx
  KTx
  Jx
South
  A987x
  Ax
  Q9x
  Axx
East
  Jxx
  Jxx
  AJxx
  KTx 


This takes up quite a lot of vertical space, but (to me) makes it easy to read the players' individual hands. Ofcourse it is not as easy to read the whole deal as the first example though.

So, which one of these notation styles (or please suggest other alternatives) would you suggest supporting? Supporting multiple ways is probably possible as well I guess.
0

#2 User is offline   TylerE 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,760
  • Joined: 2006-January-30

Posted 2013-October-25, 12:17

Best format for hands IMO is simply one line per hand, space seperated. - for a void. No special syntax, punctuation, or anything. Hands in NESW order, and a simple header row

For your example hand

N EW
Kxx T9 xxx Q987x
Jxx Jxx AJxx KTx
A987x Ax Q9x Axx
QT KQxxxx KTx Jx


Syntax extensions: Allow //comments and also treat everything leading a line up to the first colon, and leading spaces as well, as a comment, and optional punctuation between fields

So:

N, EW //With syntax extensions
  N: Kxx T9 xxx Q987x
  E: Jxx Jxx AJxx KTx
  S: A987x Ax Q9x Axx
  W: QT KQxxxx KTx Jx

0

#3 User is offline   nige1 

  • 5-level belongs to me
  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 9,128
  • Joined: 2004-August-30
  • Gender:Male
  • Location:Glasgow Scotland
  • Interests:Poems Computers

Posted 2013-October-25, 13:04

I use the formats
Board 2 NS/E
 West S:Kxx H:Tx D:xxx C:Qxxxx
North S:Jxx H:Jxx D:AJxx C:KTx
 East S:AQT987x H- D:KQT9xx C-
South S- H:AKQxxxxx D- C:AJxxx


............... North
#02............ S: J x x
NS/E........... H: J x x
............... D: A J x x
West........... C: K T x....... East
S: K x x ...................... S: A Q T 9 8 7 x.
H: T x ........................ H-
D: x x x ...................... D: K Q T 9 x x
C: Q x x x x ...South.......... C-
............... S-
7H by S........ H: A K Q x x x x x
Lead Dx........ D-
............... C: A J x x x


Advantages:
  • In the short format, each hand is the same length, even when containing voids. This helps check for hands with the wrong number of cards..
  • Easy to specify endings with few cards in each hand and lots of voids.
  • Easy to specify just two hands for bidding and defensive problems.

A special request for Kungsgeten: On your site, please insert drop boxes

  • To allow approved members to cut and paste a lump of text into the box, so that
  • Your clever software can reformat it as FD (or HTML or PDF or whatever) and
  • Dump the result in another drop-box (or email it or whatever)

0

#4 User is offline   Siegmund 

  • Alchemist
  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,764
  • Joined: 2004-June-15
  • Gender:Male
  • Location:Beside a little lake in northwestern Montana
  • Interests:Creator of the 'grbbridge' LaTeX typesetting package.

Posted 2013-October-31, 08:22

If I had to pick one of the mentioned alternatives I would take "PBN-style, but separate the hands on different rows."

I also like having every hand occupy exactly the same number of characters whether it has a void or not, so would lean against requiring "-" for a void. The price you pay for avoiding that is having to put in punctuation.
When possible try to avoid extra characters, especially ones that are hard to type: "S:xxx H:xxxx D:xxx C:xxx" would drive me batty, not just for 8 extra characters, but for the 4 colons requiring a shift-key. Ideally, case-insensitive, so I don't have to worry about capitalizing A K Q J T just to get capital letters in the printout.

At the cost of having to use a symbol for a void (unless you are willing to treat two spaces as different than one space), Kungsgeten's last two alternatives can both become usable if spaces and carriage returns are treated the same way by the parser.

Whatever you choose, try to keep it thematic with the rest of the language.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users