Article 7A12 (8-15-05) by Richard Pavlicek

Richard’s Bridge Notation


It is desirable to have a standard data format for recording, archiving and exchanging bridge deals. This should be flexible, simple and compact. A variety of formats have been proposed, but in my view they don’t pass the test.

Probably the most notable attempt is PBN (Portable Bridge Notation) which includes some good ideas but is hopelessly bloated. For example, the syntax to state the vulnerability is:

[Vulnerable “Both”]
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 data wasted, I’d be richer than Bill Gates in a week.

Another popular format is LIN (Bridgebase) which is excellent for display purposes (e.g., segments of a bridge match) but poor for archiving because of its severely limited file size (16 boards typically). Single matches must be split into multiple files, which is awkward and inconvenient.

RBN format conveniently stores any bridge match (or multiple matches) in a single file. Further, my RBN utilities will verify all data (noting any errors) and can easily convert to other formats (PBN, LIN, plus many others) including options to filter data, correct certain errors and supply missing data on-the-fly. Output can also be split into multiple files, e.g., to create separate LIN files for viewing segments of a match.

RBN format is well-organized, based on many years of experience in handling bridge data. It is compact and easy to parse by software, as well as intuitively coded to be familiar to any bridge player. RBN provides an ideal format to archive deals and maintain bridge databases. Try it! You’ll like it.

What’s New?

This document describes RBN version 2.2, which is just a slight change from versions 2.0 and 2.1, recently released. The only difference is the removal of the “N#” syntax. With the K label (team names) added in Version 2.1, it is unnecessary to state the alternating names pattern in team matches (which comprise about 90 percent of archived bridge deals). Anytime the K label exists (not null), it is assumed that the N label (player names) repeats in alternating fashion. If the K label is null, the N label repeats consecutively. Simple and logical.*

*My RBN tools will still recognize the N# syntax in old files, but output files will dispense with it.

The above change also simplifies the entire RBN structure. The first 10 labels (TDLESFKNBH) repeat automatically if unstated, and the last six (ACPRIM) never repeat. There is no longer the pound-sign (#) option to confuse the issue.

This version also adds a new scoring abbreviation: X = IMP Pairs (think “cross IMPs” to associate the X). Many pair events now use IMP scoring, so it deserves a separate indicator. This also reduces the burden on I = IMPs, which now refers only to team events.

RBN Labels and Structure

The basic structure of an RBN file is that each line begins with a one-character label, a space (for readability), then the data to the end of the line. A blank line (double CRLF) marks the end of each deal. There are 16 basic labels:

T Title and Author
D Date and Time
L Location
E Event or Main Heading
S Session, Stage or Subheading
F Form of Scoring
K Team Names and Carryovers
N Names of Players and Room or Table
B Board Number
H Hands (cards held by each player)
A Auction (dealer, vul and call sequence)
C Contract and Declarer
P Play (opening leader and play sequence)
R Result (tricks won) and Score
I Instant Awards
M Makes at Double-Dummy
Besides the above labels, any single digit (1-9) may be used to label an explanatory note. This pertains to the A (auction) label unless the P (play) label appears first, then it pertains to the play. For example:

1 forcing one round
2 artificial, spades + diamonds
In addition to labeled fields, free text may be entered at any place using this structure:

{Text paragraph}
Each text paragraph must begin on a new line and start with a left curly brace. The paragraph continues (using multiple lines if desired) until terminated by a right curly brace at the end of line, or the end of a deal (double CRLF).

To illustrate the RBN format, consider the following article that I wrote in 1993:

Florida Belles Are Ringers

Two Florida ladies put together a tremendous score — 78 percent — in the continent-wide International Fund Game on May 12. Helen Shanbrom and Julia Carswell played at the Palm Beach Bridge Studio, a popular club owned and operated by Daniel Cohen.

Winning is nothing new to Shanbrom, arguably the most successful club player of all time. Her partner has not been playing bridge that long; but she learns fast and has become a sound, reliable player. Carswell has posted a number of wins already.

The diagrammed deal shows the ladies in action, stampeding their opponents to the five level. Shanbrom, West, opened routinely with 1 S and Carswell, East, chose a single raise because her hand contained doubtful values — good judgment in my opinion. (North’s decision to overcall and South’s 4 D bid are not clearly understood, perhaps for the best.)

5 H x by North

None Vul
S J 4 2
H A J 7 6 3 2
D J
C 6 3 2
S A 8 7 6 5
H Q 10
D K 9
C A 10 8 7
[W - E]S Q 10 3
H 8 5
D Q 8 6
C K Q J 5 4
Lead: C KS K 9
H K 9 4
D A 10 7 5 4 3 2
C 9

West
1 S
4 S
Dbl
North
2 H
Pass
All Pass
East
2 S
Pass
South
4 D
5 H

Shanbrom’s push to 4 S is best explained as “It was my turn,” 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 H (actually, North is more the culprit here for the frivolous overcall). Opportunity needs knock only once for Shanbrom, and she wielded the ax.

Watch the defense! Carswell led the C K and Shanbrom followed with the seven — a wisely chosen card to 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 routinely lead a spade if she held Q-J, but in the actual layout a spade shift would be costly.

How many East defenders do you think would come through? This one did! Carswell found the killing play of another club, and declarer actually went down two when he misplayed spades later. If Carswell leads any other suit at trick two, declarer can make the contract by establishing the diamonds.

Database Format

Below is the same article in RBN format:

{Two Florida ladies put together a tremendous score -- 78 percent -- in the continent-wide International Fund Game on May 12. Helen Shanbrom and Julia Carswell played at the Palm Beach Bridge Studio, a popular club owned and operated by Daniel Cohen.}
{Winning is nothing new to Shanbrom, arguably the most successful club player of all time. Her partner has not been playing bridge that long; but she learns fast and has become a sound, reliable player. Carswell has posted a number of wins already.}
{The diagrammed deal shows the ladies in action, stampeding their opponents to the five level. Shanbrom, West, opened routinely with 1 s and Carswell, East, chose a single raise because her hand contained doubtful values -- good judgment in my opinion. (North’s decision to overcall and South’s 4 d bid are not clearly understood, perhaps for the best.)}
T Florida Belles Are Ringers:Richard Pavlicek
D 19930512
L West Palm Beach FL:Palm Beach Bridge Studio
E ACBL International Fund Game
S
F M
K
N :Helen Shanbrom+Julia Carswell
B 8
H W:A8765.QT.K9.AT87:J42.AJ7632.J.632:QT3.85.Q86.KQJ54:
A WZ:1S2H2S4D:4SPP5H:XA
C 5HX:N
P E:CK972:CQ!H483:DA9J6:D2KH28:SJ?QKA:CA
R 9-300:0
{Shanbrom’s push to 4 s is best explained as “It was my turn,” 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 h (actually, North is more the culprit here for the frivolous overcall). Opportunity needs knock only once for Shanbrom, and she wielded the ax.}
{Watch the defense! Carswell led the c K and Shanbrom followed with the seven -- a wisely chosen card to 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 routinely lead a spade if she held Q-J, but in the actual layout a spade shift would be costly.}
{How many East defenders do you think would come through? This one did! Carswell found the killing play of _another_club_, and declarer actually went down two when he misplayed spades later. If Carswell leads _any_other_suit_ at trick two, declarer can make the contract by establishing the diamonds.}
Note how the actual placement of free text emulates the text flow around the diagrams; thus the exact article could be reconstructed from the data. Text paragraphs may contain any characters except curly braces and a double CRLF (terminates deal). Paragraphs must be terminated by a right curly brace at the end of a line.*

*This was optional in the past if not followed by a label. My utilities still interpret the relaxed practice; but paragraphs are always terminated in output files.

Aside from the text, note how each data element is contained on a single line, prefixed by the appropriate label identifier. Labels S and K are not used, so they are indicated as null by the label alone.

Detailed Explanation of Labels

The 16 basic labels (TDLESFKNBHACPRIM) are described below. While each pertains to different data, all have the common syntax that a colon (:) is used as a separator. The maximum length (including the label and space after) is shown for each label, as well as a list of valid characters.

T = Title and Author

Max len: 128      Valid char: (all)
The title of an article about the deal and the author’s name, separated by a colon (:). Examples:

T Greed Costs Contract:Richard Pavlicek
T :Joe Blow (untitled, written by Joe Blow)
T Preempts:: Fact or Fiction?:Marty Bergen
The last example shows how to handle the rare case of a colon in the actual text. Double it (::) to be treated as a single colon, rather than a separator. This applies only to labels TLES. In all other labels, a colon is interpreted strictly as a separator.

D = Date and Time

Max len: 18      Valid char: 0123456789C:?
When the deal occurred. The date is given in fixed format (yyyymmdd) without separators. Unknown parts may be filled with a question mark (?), and mmdd or dd may be truncated. The letter C may be used after the year (or after the year and month) to mean “circa” (approximation).

Optionally, the date may be followed by a separator (:) and the time in 24-hour fixed format (hhmmss), of which mmss or ss may be truncated. Midnight may be indicated at the end of a day as 24 (truncated from 240000) or at the start of a day as zero. Time is local to the location the deal occurred. Examples:

D 19980131 (January 31, 1998)
D 199709 (sometime in September, 1997)
D 1996 (sometime in 1996)
D 1955C (not sure but about 1955)
D 20000509:091508 (May 9, 2000, 9:15:08 am)
D 20010704:1930 (July 4, 2001, 7:30 pm)
D 20011130:24 (Nov. 30, 2001, midnight)
D 20011201:0 (same exact time as above)

L = Location

Max len: 128      Valid char: (all)
Where the deal occurred. This may be a single string, or two strings with a separator (:). If two strings, the more general location is given first. Examples:

L Fort Lauderdale FL
L Toronto ON:Royal York Hotel
L Valkenberg NL:Holland Casino
Recommended style is to use standard two-character codes for states, provinces and countries (as shown). While flawed (e.g., IL = Illinois or Israel), the chance of ambiguity is too remote for concern.

E = Event or Main Heading

Max len: 128      Valid char: (all)
The name of the event, or a main heading (such as a catalog of lesson deals). This can be a single string, or two strings separated by a colon (:). If two strings, the more general one should be given first. Examples:

E 1999 Grand National Teams
E Southeastern Regional:Flight A Open Pairs
E Beginning Bridge:Lesson 1

S = Session, Stage or Subheading

Max len: 128      Valid char: (all)
This indicates which part of a multisession event, or a subheading (such as a lesson topic). Here also, a separator (:) is permitted for further clarification. If the part after the separator consists of a number only, it is the segment number. Examples:

S 2nd Session
S Semifinal:3 (3rd segment)
S Flight A:Round 12
S Rebids by Opener:Page 1

F = Form of Scoring

Max len: 64      Valid char: (all)
The kind of scoring in effect. This can be written as a word or phrase, or abbreviated as a single letter. Allowed abbreviations are I = IMPs, B = Board-a-Match (aka Point-a-Board), T = Total Points, X = IMP Pairs, M = Matchpoints, N = Instant Matchpoints, R = Rubber Bridge, C = Chicago, A = Cavendish (Chicago with second and third dealer nonvulnerable) and P = Plus-or-Fishfood (my creation for whichever side goes plus wins; honors don’t count). Note that abbreviations I, B and T imply team competition; all others imply pair competition.

Optionally, this may be followed by a separator (:) and modifying information. The word “old” is assumed to mean “prior to the scoring changes of 1987.” A year may be entered to indicate the scoring scale in use at that time. Examples:

F I (IMPs)
F N (Instant matchpoints)
F X:Butler (IMP pairs, Butler type)
F I:1952 (IMPs, using scale from 1952)
F M:old (Matchpoints before 1987 changes)
F A:no honors or partials (duplicate style)

K = Team Names and Carryovers

Max len: 128      Valid char: (all)
The names of two teams in a bridge match, which may be a captain’s name, country name, etc., separated by a colon. The team given first (Home Team) is North-South for the first of each pair of identical deals.

Optionally, a team name may be followed by a space and a sign (+/-) to indicate a carryover (usually IMPs but dependent on the form of scoring) that applies to the current segment. A plus carryover indicates the running total from a previous segment(s) or qualifying round(s). A minus carryover indicates an assessment made against the current segment, usually based on a penalty (e.g., slow play). Plus and minus may both be used if appropriate. Fractional carryovers with two places (decimal hundredths) are allowed. Examples:

K Nickell:Schwartz
K Italy +999:United States +2
K Meckstroth's Marauders:Rodwell's Rockets
K Iceland +76.33:Bulgaria +91.50
K France:Spain -3 (Spain penalized 3 IMPs)
K GIB +99 -3:Jack 97 (Jack ahead by 1)

N = Names of Players

Max len: 128      Valid char: (all)
The names of the players in the specific sequence: North+South:West+East. Partners are separated by a plus sign (+) and pairs by a colon (:). West is given before East to keep the left-right relationship. Names may be first or last names (or both) or even non-human names such as computers. If a name is unknown, just leave it empty. Optionally, this may be followed by a second colon (:) and the room (C = Closed, O = Open) or table number (1-250).

Examples:

N Wolff+Hamman:Stansby+Martel
N Soloway (Soloway was North)
N :Jan+Joe:O (Jan and Joe E-W in Open Room)
N :+Norman Kay:6 (Norman Kay East Table 6)
N +Roth:GIB 4.0 (Roth South, computer West)

B = Board Number

Max len: 24      Valid char: 0-9 A-Z :.-/
The board (or sequence) number of the deal. Optionally, this may be followed by a separator (:) and a second number or letter. This may represent any other numbering such as its location in large catalog of deals. A letter (or letters) may also be used to indicate the section in a large tournament. Examples:

B 7 (Board 7)
B 10:7X01 (Board 10, and RP numbering)
B 15:C (Board 15, Section C)
B 9:97-7-542 (Board 9, and OKbridge number)
B :KK (Board number unknown, Section KK)

H = Hands

Max len: 71      Valid char: 23456789AEJKNQSTW:.;
The cards for each player, starting with the direction given and moving clockwise. Each hand begins with a colon (:). Suit holdings are given in descending order (SHDC) separated by a dot (.) and cards in descending rank (AKQJT98765432).

Hands do not necessarily have to form a complete deal. Empty or incomplete hands are fine as long as no card is used twice, and no hand has more than 13 cards. This is useful for storing single hands, paired hands (e.g., only E-W for bidding practice), bridge endings, single-suit layouts, etc.

For full deals, the fourth hand is redundant and may be omitted, but the initial colon must be present (else fourth hand would be assumed not to exist). In other words, three full hands followed by a colon means “fourth hand gets the rest.”

Various examples follow.

H W:873.A6.KT864.KQ8:96.T54.97.AJ9643:T542.K93.AQ53.52:
H S:9.AK6.AKT982.K87:K7654.J73.Q65.T6:QT2.T94.J4.AQ953:
Full deals (note trailing colon). Regardless of the distribution, any full deal requires the same number of characters (55), which is a visual aid in data entry.

H N:AKQ72..AKQ72.753::.AKQ72.753.AKQ72
North and South hands only. Note that North is void in hearts and South is void in spades. Also note the extra colon to indicate the East hand is missing.

H E:T4.8642.AKT8.K65
Only the East hand.

H W:K9.K9.9:3.A3.Q.4:Q82..J.A:A7.7.K8
A five-card end position. Note that West and South are void in clubs, and East is void in hearts.

H W:43:KJ2:Q976:AT85
Only the spade suit is given for each hand.

In the last two examples note that nonessential suit separators (when a hand contains no more cards) may be removed since the hand automatically ends at a colon or the end of the line. Either way is fine with my utilities, however, output files will remove unnecessary dots only for incomplete hands (less than 13 cards); full hands will always include three dots.

Optionally, a semicolon may be used in place of any colon to indicate the hand following should be hidden for normal purposes. This is useful for quizzes, polls, play problems, etc., where only a portion of the diagram should be shown. For example:

H W:A875.632.76.8643;Q632.Q87.J842.Q2:KJT4.KJT4.AQ3.AJ;
Above describes a full deal but indicates that only the West and East hands should be shown. Note that the North hand begins with a semicolon, and the trailing semicolon means that South exists (but is hidden).

H W:A8765.QT.K9.AT87;J42.AJ7632.J.632;QT3.85.Q86.KQJ54;
Again a full deal, but only the West hand should be shown, as for an opening-lead problem.

H E;K5.T.KQJT98.KQJT:A876.A2.765.A876;32.KQJ9876543..9:
H S:A876.A2.765.A876;32.KQJ9876543..9:QJT94..A432.5432;
H W;32.KQJ9876543..9:QJT94..A432.5432;K5.T.KQJT98.KQJT:
H N:QJT94..A432.5432;K5.T.KQJT98.KQJT:A876.A2.765.A876;
The above examples show the exact same deal and hidden status (only N-S hands should be shown) and are included to emphasize that any hand may be given first. My output utilities select the starting hand as the first non-hidden hand with cards in the priority WNES; so the last example would be used.

A = Auction

Max len: 128      Valid char: 123456789ABCDEHNPRSWXYZ:!?*^
The dealer (NESW) and vulnerability (ZNEB), then each bidding round is preceded by a colon. No other separators are used in the sequence of calls.

Normal calls are indicated as: P = Pass, X = Double, R = Redouble, 1C = One Club, 3N = Three Notrump, A = All Pass. Further, the letter Y may be used as a query point (multiple times are allowed) to mean “Your call?” as in a bidding quiz or poll. Partial or incomplete auctions are allowed (just stop writing). Complete auctions must end in A or PPP.

Any call (except A and Y) may by followed by a notation: ! = good, ? = poor, !! = very good, ?? = very poor, !? = speculative, ?! = questionable, * = conventional (no explanation follows), ^1 = see Note 1.

Examples:

A SZ:1SP2SP:4SA (South deals, none vul)
A EN (East deals N-S vul, no auction given)
A WE:A (West deals E-W vul, passed out)
A NB:1SXY (your call as South?)
A S:1SP2CP:2D (vul unknown, incomplete)
A EB:3CP3N?P:PX!R^1A (East deals, both vul)
In the last example West’s 3 NT bid was poor and South made a good double. The ^1 after the redouble means a note follows, and the next line might say:

1 Apparently lost his mind

C = Contract and Declarer

Max len: 9      Valid char: 0123456789CDEHMNPRSWX:
The final contract and direction of the declarer, separated by a colon (:), or the single letter P if passed out. Optionally, the declarer may be immediately followed by a number (or M = maximum) to state a goal. This goal is necessary for end positions (contract is just a suit or notrump with no level) and is useful when the object is to win a certain number of tricks rather than to make a contract, such as a sacrifice. Examples:

C 5D:N (Five diamonds, North declarer)
C P (Passed out)
C 6HR:W (Six hearts rdbld, West declarer)
C 4SX:S8 (true goal to win 8 tricks)
The last example is appropriate for a sacrifice bid of four spades at equal vulnerability; i.e., object is to go down two (at most).

C N:S6 (Notrump, South declarer, win 6)
C C:EM (Clubs, East declarer, win maximum)
Above are endings (partial deals) stating the strain, declarer and the number of tricks required (M stands for maximum). The player on lead would be indicated in the P (play) label.

P = Play

Max len: 128   Valid char: 123456789ACDEHJKNQSTWY:+-!?*^
The direction of the opening leader and the play sequence. Each trick is preceded by a colon (:) but no other separators are used. The play sequence is exactly as it would occur at the table; each trick starts with the lead and is followed by the next three plays in order. The play can end at any time (just stop writing).

Plays are shown by suit and rank, except if following to the suit led, then only the rank is given. When a play is insignificant its rank may be indicated with a minus sign (-) to mean the lowest card, or a plus sign (+) to mean the highest card.

The letter Y may be used as a query point to mean “Your play?” but no further plays may follow (hence it can be used only once at the end).

Any play (except Y) may be followed by a notation: ! = good, ? = poor, !! = very good, ?? = very poor, !? = speculative, ?! = questionable, * = conventional (no explanation follows), ^1 = see Note 1. Examples:

P N:SK54T:SA87H3:HA245:HKQ8J
P W:DA762:Y (your lead at trick two?)
P S:HQ*3J2:HK47A:DJA53:HT68C7^1
In the last example the opening lead of the queen is conventional but not explained. The club discard at Trick 4 is noted, and the next line might say:

1 A subtle falsecard

R = Result and Score

Max len: 16      Valid char: 0123456789P:+-=.
The result is the number of tricks won by declarer (or the letter P if passed out). This may be followed immediately by a sign (+/-) and the actual raw score.

Optionally, this may be followed by a separator (:) and the effective score. This may be an equal sign (=) to indicate a push or tie, a sign (+/-) and a number of IMPs (+1 or -1 for board-a-match), or a plain number to indicate a matchpoint percentage. Decimal fractions of two places (hundredths) are allowed. All scores (raw or effective) are relative to North-South. Examples:

R 11 (declarer won 11 tricks)
R 10+620 (declarer won 10 tricks, NS +620)
R 8-300:+4 (8 tricks, EW +300, NS +4 IMPs)
R P:-2 (passed out, EW won 2 IMPs)
R 12-980:-11 (12 tricks, EW +980, +11 IMPs)
R :66.67 (result unknown, NS 66.67 percent)
R 5:-1 (5 tricks won, EW won board if BAM)
R +2140:+12.29 (NS +2140 and +12.29 IMPs)
R 7-750:7 (7 tricks, EW +750, 93 percent)
R 9-100:= (9 tricks, EW +100, tie board)
Note that a push at IMPs is shown by an equal sign. If you write a plain zero it means 0 percent.

I = Instant Awards

Max len: 512      Valid char: (all)
This label is used for any prepared award scale that applies to the current deal. Awards may be for the call of the player with the pseudo call Y in the A (auction) label, or for the play of the player with the pseudo play Y in the P (play) label.

If there are no pseudo calls or plays, awards are assumed to be “instant matchpoints” if a full deal exists with no hidden hand. If a hand is missing or hidden, and two partnership hands exist (non-hidden), awards are for that partnership, typically for contracts reached in partnership bidding practice.

Listing is in the form [description]=[award], where description can be a call or contract (3N), a lead or play (SK), a phrase such as “Win first trick; lead HK” or a bridge score divided by 10. The last is to save space in a long list of scores by omitting trailing zeros (I think Harold Vanderbilt was obsessed with his millions when he invented contract bridge scoring).

Awards must be positive whole numbers (no fractions), and the list must be ordered from best to worst. Except for instant matchpoints, any award scale may be used. My practice is to use a 10 scale for most purposes, as in my monthly polls and contests. Examples:

I 3N=10:4S=7:6S=5:P=4:5S=3:4N=1 (calls)
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
The last listing (declarer-play options) is curtailed. Note that the semicolons are just plain text (colons and equal signs, of course, cannot be in the text).

For instant matchpoints, scores and awards are given relative to North-South. Scores are assumed to be plus (for N-S) until any score is preceded by a minus sign; then all subsequent scores are also minus. Awards must be given as a percentage (100 scale). Corresponding E-W awards are simply the difference between the N-S award and 100. For example:

I 80=99:98:75=97:95:67=94:92:50=90
List is curtailed. Note that awards of 98, 95 and 92 are given without description and equal sign. This signifies a “gap award” for scores between the score on the left and the score on the right. Also note the implied end gaps; i.e., any score above 80 (800) gets 100, and anything below the last listed score (not shown) gets 0.

I 10=98:95:5=91:88:-40=83:42=75:43=65
Note the transition from plus to minus. After the N-S score of 5 (meaning +50) and a gap award, the next score is -40 (-400). All subsequent N-S scores must also be minus, so repeating the sign is unnecessary.

M = Makes at Double-Dummy

Max len: 36      Valid char: 0123456789ABCDFM:+=!?
Indicates the number of tricks declarer can win in the given contract against best defense after the opening lead. This may be followed by a second number, meaning after the lead to trick two; and a third, meaning after the lead to trick three; etc., up to 10 such numbers. All numbers refer to the total number of tricks (including past tricks). Optionally, a letter (M = makes, F = fails) may be used instead of a number if success or failure is known but not the exact number of tricks.

Numbers 10-13 are given in hexadecimal (A-D) to avoid confusion and save space, allowing a one-digit representation of all numbers.

Optionally, this may be followed by a separator (:) and a list of double-dummy makes for N-S without specified leads. North’s makes are given first, followed by a plus (+) sign, then South’s. Makes consist of five numbers, one for each strain in the sequence NSHDC. Unknown makes can be truncated or replaced with a question mark (?) as a placeholder. If South’s makes are the same as North (often true), replace the plus sign with an equal sign (=) and omit the duplicate list.

Optionally, this may be followed by a second separator (:) and a similar listing for West (first) then East. (Note that this structure “North+South:West+East” is the same as for the N label.) As a further shortcut, if West’s makes plus North’s makes total 13 in all strains (quite common), this may be shown by a logical Not symbol (!). Likewise, if East’s makes plus South’s makes total 13. If a deal is square all around, prefer to use “!=” although “!!” means the same. Examples:

M 9 (declarer can win 9 tricks after lead)
M BA (11 after lead, 10 after TR-2 lead)
M F (fails against best defense after lead)
M A:88DAC (10 after lead, North analysis)
M :978A7+979A7:46435+45436 (full analysis)
M :BAB8A+AAA89:22253= (as above E-W same)
M C:DCC99=:!= (12 after lead, equal around)
The above indicates a deal with no opening-lead dependencies. North makes 13 tricks in notrump, 12 in either major, and 9 in either minor. South makes the same, and West or East makes the difference (from 13). Note that no plus sign is used when ! or = appears.

M :+??A (South can win 10 tricks in hearts)
M 9:?4=:?8+?9 (9 with lead, spade analysis)
Note that because of the fixed format of the five strains, placeholders (?) are necessary to skip unknown or immaterial values. The last example means that in spades North or South can win 4 tricks; West 8, and East 9. If the actual contract were, say, 3S by West, it also shows that the opening lead was favorable.

General Database Rules

The labels TDLESFKNBH are required for each deal and presumed to repeat until altered. This is a great convenience and space saver because these labels are often the same for a group of deals (sometimes for an entire file). If any of these labels is unused (unknown or immaterial), it should be set null at the first deal by using the label alone without data.*

*Technically, this isn’t necessary for a single file (unspecified labels are assumed null), but it prevents a problem when joining two RBN files. Without this precaution, the second file might inherit undesired repeats from the first file.

Repetition pattern of the N label (player names) is governed by the K label (team names). If the K label exists (not null), the N label repeats in alternating fashion as established by the previous two occurrences (typically on the first board of a segment). If the K label is null, the N label repeats consecutively like the other repeating labels.

The remaining labels (ACPRIM) do not repeat and are assumed to be null unless explicitly entered.

The order of labels in a deal makes no difference, except for the use of notes (1-9). Notes are assumed to apply to the A (auction) label until the P (play) label is encountered, then they are assumed to apply to the play. All output files created by my RBN utilities order labels TDLESFKNBHACPRIM (most logical I think) regardless of the input order. Notes (if any) are placed immediately after the appropriate A or P label.

Case (upper or lower) is significant only in labels TLESFKNI, which allow all characters. Otherwise, case is insignificant — upper and lowercase are interpreted the same. My RBN utilities use uppercase for all case-insignificant output (as shown by examples in this document) but either case is OK for input.

A space character (ASCII 32) is required after each label (except null labels). Otherwise, spaces are permitted only in label data that accepts all characters (TLESFKNI). Spaces are not allowed in the data of labels DBHACPRM.*

*My RBN utilities check each label for valid characters. If an invalid space (or other character) is found, the program will stop processing the current file and exit with an error message, showing the line number of the faulty character.

Free-text paragraphs (starting with a left curly brace) may be placed anywhere, but always at the start of a line. The paragraph continues until (1) a right curly brace is encountered at the end of a line, or (2) a left curly brace is encountered at the start of line to begin a new paragraph, or (3) the deal ends (two CRLFs). Paragraphs before the H label are presumed to appear before the diagram; paragraphs after the H label are 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.
Note that there is no blank line between extraneous text and the first label, as two CRLFs terminate a deal. (Adding a blank line would result in an extra “deal” with all null labels.) For the same reason, you cannot put blank lines in free text. Also note that the last deal in a file also should be followed by a blank line (two CRLFs). This good practice not only avoids confusing software parsers but makes it easy to concatenate two or more RBN files, ensuring proper deal separation.

The maximum line length is shown for each label. Except for the I label (allowing 512) the longest is 128. This length includes the label and space but not the CRLF. In theory, it is possible to have longer auctions, or excessively long names, etc., but in practice I’ve never come close. (If you expect to exceed this amount, you need a storybook, not a database.) Note that this limit does not apply to free text, which may have lines of any length, subject to the deal-size restriction.

The maximum size of any single deal is 16,384 bytes. Obviously, this could only be approached by the inclusion of free text. To give you an idea how this relates, the “Florida Belles Are Ringers” article uses only 2291 bytes; so it’s hard to imagine needing more than 16K for one deal. There is no limit on the size of an RBN file — well, except the DOS file-size limit of 2 gigabytes, but that’s hardly a concern.


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.