Professional Documents
Culture Documents
I
t is desirable to have a standard data format for The above change also simplifies the entire RBN
recording, archiving and exchanging bridge deals. structure. The first 10 labels (TDLESFKNBH) repeat
This should be flexible, simple and compact. A automatically if unstated, and the last six (ACPRIM)
variety of formats have been proposed, but in my view never repeat. There is no longer the pound-sign (#)
they don’t pass the test. option to confuse the issue.
Probably the most notable attempt is PBN (Portable This version also adds a new scoring abbreviation:
Bridge Notation) which includes some good ideas but X = IMP Pairs (think “cross IMPs” to associate the X).
is hopelessly bloated. For example, the syntax to state Many pair events now use IMP scoring, so it deserves
the vulnerability is: a separate indicator. This also reduces the burden on
[Vulnerable “Both”] I = IMPs, which now refers only to team events.
Really? Do I have to write the word “Vulnerable”
every time? And why are the confusing brackets and
quotes needed? If I had a penny for every megabyte of RBN Labels and Structure
data wasted, I’d be richer than Bill Gates in a week. The basic structure of an RBN file is that each line
Another popular format is LIN (Bridgebase) which begins with a one-character label, a space (for read-
is excellent for display purposes (e.g., segments of a ability), then the data to the end of the line. A blank line
bridge match) but poor for archiving because of its (double CRLF) marks the end of each deal. There are
severely limited file size (16 boards typically). Single 16 basic labels:
matches must be split into multiple files, which is
awkward and inconvenient. T Title and Author
D Date and Time
RBN format conveniently stores any bridge match L Location
(or multiple matches) in a single file. Further, my RBN E Event or Main Heading
utilities will verify all data (noting any errors) and can S Session, Stage or Subheading
easily convert to other formats (PBN, LIN, plus many F Form of Scoring
others) including options to filter data, correct certain K Team Names and Carryovers
errors and supply missing data on-the-fly. Output can N Names of Players and Room or Table
also be split into multiple files, e.g., to create separate B Board Number
H Hands (cards held by each player)
LIN files for viewing segments of a match.
A Auction (dealer, vul and call sequence)
RBN format is well-organized, based on many years C Contract and Declarer
of experience in handling bridge data. It is compact and P Play (opening leader and play sequence)
easy to parse by software, as well as intuitively coded R Result (tricks won) and Score
to be familiar to any bridge player. RBN provides an I Instant Awards
ideal format to archive deals and maintain bridge data- M Makes at Double-Dummy
bases. Try it! You’ll like it. Besides the above labels, any single digit (1-9) may
be used to label an explanatory note. This pertains to
What’s New? the A (auction) label unless the P (play) label appears
This document describes RBN version 2.2, which is first, then it pertains to the play. For example:
just a slight change from versions 2.0 and 2.1, recently 1 forcing one round
released. The only difference is the removal of the 2 artificial, spades + diamonds
“N#” syntax. With the K label (team names) added in
Version 2.1, it is unnecessary to state the alternating In addition to labeled fields, free text may be entered
names pattern in team matches (which comprise about at any place using this structure:
90 percent of archived bridge deals). Anytime the K {Text paragraph}
label exists (not null), it is assumed that the N label
(player names) repeats in alternating fashion. If the K Each text paragraph must begin on a new line and
label is null, the N label repeats consecutively. Simple start with a left curly brace. The paragraph continues
and logical.* (using multiple lines if desired) until terminated by a
*My RBN tools will still recognize the N# syntax in old files, but output files
right curly brace at the end of line, or the end of a deal
will dispense with it. (double CRLF).
To illustrate the RBN format, consider the following Database Format
article that I wrote in 1993:
Below is the same article in RBN format:
Florida Belles Are Ringers {Two Florida ladies put together a tremendous score
-- 78 percent -- in the continent-wide International
Two Florida ladies put together a tremendous score Fund Game on May 12. Helen Shanbrom and Julia
— 78 percent — in the continent-wide International Carswell played at the Palm Beach Bridge Studio, a
popular club owned and operated by Daniel Cohen.}
Fund Game on May 12. Helen Shanbrom and Julia {Winning is nothing new to Shanbrom, arguably the
Carswell played at the Palm Beach Bridge Studio, a most successful club player of all time. Her partner
has not been playing bridge that long; but she learns
popular club owned and operated by Daniel Cohen. fast and has become a sound, reliable player.
Winning is nothing new to Shanbrom, arguably the most suc- Carswell has posted a number of wins already.}
{The diagrammed deal shows the ladies in action,
cessful club player of all time. Her partner has not been playing stampeding their opponents to the five level.
bridge that long; but she learns fast and has become a sound, Shanbrom, West, opened routinely with 1 s and
reliable player. Carswell has posted a number of wins already. Carswell, East, chose a single raise because her hand
contained doubtful values -- good judgment in my
The diagrammed deal shows the ladies in action, stampeding opinion. (North’s decision to overcall and South’s
their opponents to the five level. Shanbrom, West, opened rou- 4 d bid are not clearly understood, perhaps for the
tinely with 1 ♠ and Carswell, East, chose a single raise because best.)}
T Florida Belles Are Ringers:Richard Pavlicek
her hand contained doubtful values — good judgment in my
opinion. (North’s decision to overcall and South’s 4 ♦ bid are not
D 19930512
L West Palm Beach FL:Palm Beach Bridge Studio
clearly understood, perhaps for the best.) E ACBL International Fund Game
S
F M
5 ♥ x by North ♠J42 None Vul K
♥AJ7632 N :Helen Shanbrom+Julia Carswell
B 8
♦J H W:A8765.QT.K9.AT87:J42.AJ7632.J.632:QT3.85.Q86.KQJ54:
♣632 A WZ:1S2H2S4D:4SPP5H:XA
C 5HX:N
♠A8765 ♠ Q 10 3 P E:CK972:CQ!H483:DA9J6:D2KH28:SJ?QKA:CA
♥ Q 10 N ♥85 R 9-300:0
{Shanbrom’s push to 4 s is best explained as “It was
♦K 9 W
S
E
♦Q 8 6 my turn,” but this is the kind of aggressive tactic
♣ A 10 8 7 ♣KQJ54 that a clever player senses to be right at the table.
Sure enough, South took the bait and pushed to 5 h
♠K9 (actually, North is more the culprit here for the
frivolous overcall). Opportunity needs knock only
♥K94 once for Shanbrom, and she wielded the ax.}
♦ A 10 7 5 4 3 2 {Watch the defense! Carswell led the c K and Shanbrom
followed with the seven -- a wisely chosen card to
Lead: ♣ K ♣9 de-emphasize the desirability of a spade switch. (The
partnership, as do most defenders, indicate suit
preference when the dummy has a singleton in the suit
led.) Shanbrom figured that her partner would
West North East South
4♦
routinely lead a spade if she held Q-J, but in the
1♠ 2♥ 2♠ actual layout a spade shift would be costly.}
4♠ Pass Pass 5♥ {How many East defenders do you think would come
through? This one did! Carswell found the killing
Dbl All Pass play of _another_club_, and declarer actually went
down two when he misplayed spades later. If Carswell
Shanbrom’s push to 4 ♠ is best explained as “It was my turn,”
leads _any_other_suit_ at trick two, declarer can
make the contract by establishing the diamonds.}
but this is the kind of aggressive tactic that a clever player senses
to be right at the table. Sure enough, South took the bait and pushed
to 5 ♥ (actually, North is more the culprit here for the frivolous Note how the actual placement of free text emulates
overcall). Opportunity needs knock only once for Shanbrom, and the text flow around the diagrams; thus the exact article
she wielded the ax. could be reconstructed from the data. Text paragraphs
Watch the defense! Carswell led the ♣ K and Shanbrom fol- may contain any characters except curly braces and a
lowed with the seven — a wisely chosen card to de-emphasize the double CRLF (terminates deal). Paragraphs must be
desirability of a spade switch. (The partnership, as do most de- terminated by a right curly brace at the end of a line.*
fenders, indicate suit preference when the dummy has a singleton
in the suit led.) Shanbrom figured that her partner would routinely
*This was optional in the past if not followed by a label. My utilities still
lead a spade if she held Q-J, but in the actual layout a spade shift interpret the relaxed practice; but paragraphs are always terminated in output files.
would be costly.
How many East defenders do you think would come through? Aside from the text, note how each data element is
This one did! Carswell found the killing play of another club, and
declarer actually went down two when he misplayed spades later. contained on a single line, prefixed by the appropriate
If Carswell leads any other suit at trick two, declarer can make the label identifier. Labels S and K are not used, so they are
contract by establishing the diamonds. indicated as null by the label alone.
Detailed Explanation of Labels Recommended style is to use standard two-character
The 16 basic labels (TDLESFKNBHACPRIM) are codes for states, provinces and countries (as shown).
described below. While each pertains to different data, While flawed (e.g., IL = Illinois or Israel), the chance
all have the common syntax that a colon (:) is used as of ambiguity is too remote for concern.
a separator. The maximum length (including the label
and space after) is shown for each label, as well as a list E = Event or Main Heading
of valid characters. Max len: 128 Valid char: (all)
The direction of the opening leader and the play This label is used for any prepared award scale that
sequence. Each trick is preceded by a colon (:) but no applies to the current deal. Awards may be for the call
other separators are used. The play sequence is exactly of the player with the pseudo call Y in the A (auction)
as it would occur at the table; each trick starts with the label, or for the play of the player with the pseudo play
lead and is followed by the next three plays in order. Y in the P (play) label.
The play can end at any time (just stop writing). If there are no pseudo calls or plays, awards are
Plays are shown by suit and rank, except if following assumed to be “instant matchpoints” if a full deal exists
to the suit led, then only the rank is given. When a play with no hidden hand. If a hand is missing or hidden,
is insignificant its rank may be indicated with a minus and two partnership hands exist (non-hidden), awards
sign (-) to mean the lowest card, or a plus sign (+) to are for that partnership, typically for contracts reached
mean the highest card. in partnership bidding practice.
The letter Y may be used as a query point to mean Listing is in the form [description]=[award], where
“Your play?” but no further plays may follow (hence it description can be a call or contract (3N), a lead or play
can be used only once at the end). (SK), a phrase such as “Win first trick; lead HK” or a
Any play (except Y) may be followed by a notation: bridge score divided by 10. The last is to save space in
! = good, ? = poor, !! = very good, ?? = very poor, !? = a long list of scores by omitting trailing zeros (I think
speculative, ?! = questionable, * = conventional (no Harold Vanderbilt was obsessed with his millions when
explanation follows), ^1 = see Note 1. Examples: he invented contract bridge scoring).
P N:SK54T:SA87H3:HA245:HKQ8J Awards must be positive whole numbers (no frac-
P W:DA762:Y (your lead at trick two?) tions), and the list must be ordered from best to worst.
P S:HQ*3J2:HK47A:DJA53:HT68C7^1
Except for instant matchpoints, any award scale may be
In the last example the opening lead of the queen is used. My practice is to use a 10 scale for most purposes,
conventional but not explained. The club discard at as in my monthly polls and contests. Examples:
Trick 4 is noted, and the next line might say: I 3N=10:4S=7:6S=5:P=4:5S=3:4N=1 (calls)
1 A subtle falsecard I SK=10:HK=9:H8=7:HT=4:D3=3:CK=2 (leads)
I Win HA; lead SK=10:Win HA; lead H2=8
R = Result and Score The last listing (declarer-play options) is curtailed.
Max len: 16 Valid char: 0123456789P:+-=. Note that the semicolons are just plain text (colons and
The result is the number of tricks won by declarer (or equal signs, of course, cannot be in the text).
the letter P if passed out). This may be followed imme- For instant matchpoints, scores and awards are given
diately by a sign (+/-) and the actual raw score. relative to North-South. Scores are assumed to be plus
Optionally, this may be followed by a separator (:) (for N-S) until any score is preceded by a minus sign;
and the effective score. This may be an equal sign (=) then all subsequent scores are also minus. Awards must
to indicate a push or tie, a sign (+/-) and a number of be given as a percentage (100 scale). Corresponding
IMPs (+1 or -1 for board-a-match), or a plain number E-W awards are simply the difference between the N-S
to indicate a matchpoint percentage. Decimal fractions award and 100. For example:
of two places (hundredths) are allowed. All scores (raw I 80=99:98:75=97:95:67=94:92:50=90
or effective) are relative to North-South. Examples:
R 11 (declarer won 11 tricks)
List is curtailed. Note that awards of 98, 95 and 92
R 10+620 (declarer won 10 tricks, NS +620) are given without description and equal sign. This
R 8-300:+4 (8 tricks, EW +300, NS +4 IMPs) signifies a “gap award” for scores between the score on
R P:-2 (passed out, EW won 2 IMPs) the left and the score on the right. Also note the implied
R 12-980:-11 (12 tricks, EW +980, +11 IMPs) end gaps; i.e., any score above 80 (800) gets 100, and
R :66.67 (result unknown, NS 66.67 percent) anything below the last listed score (not shown) gets 0.
R 5:-1 (5 tricks won, EW won board if BAM)
R +2140:+12.29 (NS +2140 and +12.29 IMPs) I 10=98:95:5=91:88:-40=83:42=75:43=65
R 7-750:7 (7 tricks, EW +750, 93 percent) Note the transition from plus to minus. After the N-S
R 9-100:= (9 tricks, EW +100, tie board)
score of 5 (meaning +50) and a gap award, the next
Note that a push at IMPs is shown by an equal sign. score is -40 (-400). All subsequent N-S scores must
If you write a plain zero it means 0 percent. also be minus, so repeating the sign is unnecessary.
M = Makes at Double-Dummy General Database Rules
Max len: 36 Valid char: 0123456789ABCDFM:+=!?
The labels TDLESFKNBH are required for each
Indicates the number of tricks declarer can win in the deal and presumed to repeat until altered. This is a great
given contract against best defense after the opening convenience and space saver because these labels are
lead. This may be followed by a second number, mean- often the same for a group of deals (sometimes for an
ing after the lead to trick two; and a third, meaning after entire file). If any of these labels is unused (unknown
the lead to trick three; etc., up to 10 such numbers. All or immaterial), it should be set null at the first deal by
numbers refer to the total number of tricks (including using the label alone without data.*
past tricks). Optionally, a letter (M = makes, F = fails) *Technically, this isn’t necessary for a single file (unspecified labels are
may be used instead of a number if success or failure is assumed null), but it prevents a problem when joining two RBN files. Without this
known but not the exact number of tricks. precaution, the second file might inherit undesired repeats from the first file.
Numbers 10-13 are given in hexadecimal (A-D) to Repetition pattern of the N label (player names) is
avoid confusion and save space, allowing a one-digit governed by the K label (team names). If the K label
representation of all numbers. exists (not null), the N label repeats in alternating
Optionally, this may be followed by a separator (:) fashion as established by the previous two occurrences
and a list of double-dummy makes for N-S without (typically on the first board of a segment). If the K label
specified leads. North’s makes are given first, followed is null, the N label repeats consecutively like the other
by a plus (+) sign, then South’s. Makes consist of five repeating labels.
numbers, one for each strain in the sequence NSHDC.
The remaining labels (ACPRIM) do not repeat and
Unknown makes can be truncated or replaced with a
are assumed to be null unless explicitly entered.
question mark (?) as a placeholder. If South’s makes are
the same as North (often true), replace the plus sign The order of labels in a deal makes no difference,
with an equal sign (=) and omit the duplicate list. except for the use of notes (1-9). Notes are assumed to
Optionally, this may be followed by a second sepa- apply to the A (auction) label until the P (play) label is
rator (:) and a similar listing for West (first) then East. encountered, then they are assumed to apply to the
(Note that this structure “North+South:West+East” is play. All output files created by my RBN utilities order
the same as for the N label.) As a further shortcut, if labels TDLESFKNBHACPRIM (most logical I think)
West’s makes plus North’s makes total 13 in all strains regardless of the input order. Notes (if any) are placed
(quite common), this may be shown by a logical Not immediately after the appropriate A or P label.
symbol (!). Likewise, if East’s makes plus South’s Case (upper or lower) is significant only in labels
makes total 13. If a deal is square all around, prefer to TLESFKNI, which allow all characters. Otherwise,
use “!=” although “!!” means the same. Examples: case is insignificant — upper and lowercase are inter-
M 9 (declarer can win 9 tricks after lead)
preted the same. My RBN utilities use uppercase for all
M BA (11 after lead, 10 after TR-2 lead) case-insignificant output (as shown by examples in this
M F (fails against best defense after lead) document) but either case is OK for input.
M A:88DAC (10 after lead, North analysis) A space character (ASCII 32) is required after each
M :978A7+979A7:46435+45436 (full analysis) label (except null labels). Otherwise, spaces are permit-
M :BAB8A+AAA89:22253= (as above E-W same)
ted only in label data that accepts all characters (TLES-
M C:DCC99=:!= (12 after lead, equal around)
FKNI). Spaces are not allowed in the data of labels
The above indicates a deal with no opening-lead DBHACPRM.*
dependencies. North makes 13 tricks in notrump, 12 in
*My RBN utilities check each label for valid characters. If an invalid space (or
either major, and 9 in either minor. South makes the other character) is found, the program will stop processing the current file and exit
same, and West or East makes the difference (from 13). with an error message, showing the line number of the faulty character.
Note that no plus sign is used when ! or = appears.
Free-text paragraphs (starting with a left curly brace)
M :+??A (South can win 10 tricks in hearts) may be placed anywhere, but always at the start of a
M 9:?4=:?8+?9 (9 with lead, spade analysis)
line. The paragraph continues until (1) a right curly
Note that because of the fixed format of the five brace is encountered at the end of a line, or (2) a left
strains, placeholders (?) are necessary to skip unknown curly brace is encountered at the start of line to begin a
or immaterial values. The last example means that in new paragraph, or (3) the deal ends (two CRLFs).
spades North or South can win 4 tricks; West 8, and Paragraphs before the H label are presumed to appear
East 9. If the actual contract were, say, 3S by West, it before the diagram; paragraphs after the H label are
also shows that the opening lead was favorable. presumed to appear after the diagram.
File Signature and Limits
To be identified as an RBN file, the first line must
begin with “% RBN” (no quotes) or “%RBN” (i.e., the
space is optional). A percent sign may also be used at
the start of any line (except within free text) to indicate
extraneous information that is not part of the data. This
is commonly used at the start of a file to describe its
contents. For example:
% RBN 2.2
% Copyright 2004 Richard Pavlicek
% 36 deals, recommended bidding, and awards
T ACBL Instant MP Pairs:Richard Pavlicek
D ... etc.
Summary
The RBN format produces data files that are simple,
flexible, and easy to parse by software. The RBN file
is also smaller than other textual formats — usually less
than one-third the size of an equivalent PBN file.
This edition (version 2.2) represents a reasonably
finalized format, which has been refined over eight
years of continued use. Try it! I think you’ll find it the
best way to incorporate bridge deals into a database.
-Richard Pavlicek (e-mail: richard@rpbridge.net)
Copyright © 2005 Richard Pavlicek. All rights reserved.