Main     Article 7A12 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 a few good ideas but is hopelessly bloated. For example, the syntax to state the vulnerability is: [Vulnerable “Both”].

Hello-o-o? Do I really have to write the word “Vulnerable” every time? Most people abbreviate it in ordinary writing, so this is outrageous for a data format. And why are brackets and quotes both required?

PBN also has a number of design flaws, perhaps because it was derived from a notation used in chess (PGN) rather than originated for bridge. For instance, the default ordering of tags is illogical, and the play syntax must have been thought up by monkeys.

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 limited file size (16 boards typically). Single matches must be split into multiple files.

RBN conveniently stores any number of deals — a complete match, an entire event, multiple events, etc. — in a single file. My RBN utilities will verify data (noting errors) and easily convert to many formats (PBN, LIN, PPL, etc.) with options to filter data, correct certain errors, supply missing data on-the-fly, and split output into multiple files, e.g., to create separate files for each segment of a match.

RBN is compact and well-organized, based on many years of working with bridge data. It is ideal for maintaining a bridge database, and the intuitive coding will be familiar to any bridge player. Try it! You’ll like it.

What’s New?

RBN version 2.7 contained a few slight additions: (1) Bidding and play annotations, previously 1-9, now allow the number 0 as a general note without a diagram reference; (2) P label now allows a semicolon trick separator (instead of a colon) to mean “remaining plays are trivial”; (3) Case is preserved for call denominations (CDHSNPXR) in the A label and suits (CDHS) in the P label to allow personal coding, e.g., I use lowercase to designate calls or plays that should be quizzed; (4) N label now allows an additional field for further info; (5) B label now allows all characters to accommodate diverse usage.

Version 2.8 effected a change in the K label format when carryovers exist. (I seldom used this, and the old method was awkward to parse.) Carryovers now have separate fields after the team names.

Version 2.9 effected a slight change in the C label. If the leader must be specified (not left of declarer) it is shown after declarer separated by a colon.

Version 3.0 allowed more general use of the I label (item list) including multi-line listings for readability.

Version 3.1 (current): D label (date) is now first in standard output order to facilitate online file parsing. Labels F and C allow additional fields (colon separated) for any user-desired purpose.

TopMain

RBN Labels and Structure

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

D Date and Time
T Title and Author
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 sequence
R Result (tricks won) and Score
M Makes at Double-Dummy
I Item List
Besides the above labels, any single digit (0-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
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 (but no blank lines) until terminated by a right curly brace at the end of a line.

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.)

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.

5 H× 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
TableS 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

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.

Same Article in RBN

D 19930512
T Florida Belles Are Ringers:Richard Pavlicek
L West Palm Beach FL:Palm Beach Bridge Studio
E ACBL International Fund Game
F M
N :Helen Shanbrom+Julia Carswell
{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 1s 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 4d bid are not clearly understood, perhaps for the best.)}
{Shanbrom's push to 4s 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 5h (actually, North is more the culprit here for the frivolous overcall). Opportunity needs knock only once for Shanbrom, and she wielded the ax.}
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 CK972:CQ!H483:DA9J6:D2KH28:SJ?QKA:CA
R 9-300:0
{Watch the defense! Carswell led the cK 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 each RBN label and its data is contained on a single line (mandatory except for the I label if used) and there are no blank lines. (A blank line separates records in an RBN file.)

Labels SKMI are not needed so they're omitted, which by default presumes them to be null.

Paragraphs of free text (surrounded by curly braces) can be placed anywhere, however, good practice is to emulate their position as appearing before or after the hand diagram (H label). This allows the article to be reconstructed exactly from the data.

TopMain

Detailed Explanation of Labels

The 16 basic labels 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.

D = Date and Time

Max len: 18  Valid char: 0123456789CG:?
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 year and month) to mean “circa” (approximation). Optionally, a second date may be given (yyyymmdddd) to indicate a span (if lower wraps to next month).

The date (if not a span) may be followed by a colon (:) 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 or at the start as 00.

Date and time are local to the location (L label) unless followed by the letter G (GMT). Examples:

D 19980131 (January 31, 1998)
D 199709 (some date in September, 1997)
D 1986120911 (December 9-11, 1986)
D 1955C (not sure but about 1955)
D 20010704:1930 (July 4, 2001, 7:30 pm)
D 20120428:072315G (to exact second GMT)

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.

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 11

S = Session, Stage or Subheading

Max len: 128  Valid char: (all)
The part of an event, or a subheading such as a lesson topic. A number alone indicates the session (typically in a pair event). Allowed abbreviations are F = Final, P = Playoff, S = Semifinal, Q = Quarterfinal, R16 = Round of 16 (likewise for any number) or I = Initial stage (Qualifying). A separator (:) allows further clarification, where a number alone indicates the segment or round. Examples:

S 2 (Session 2)
S S:3 (Semifinal, Segment 3)
S R32:1 (Round of 32, Segment 1)
S I:12 (Qualifying, Round 12)
S Slam Bidding:Blackwood

F = Form of Scoring

Max len: 64  Valid char: (all)
The kind of scoring in effect. This can be a word, phrase or one-letter abbreviation: I = IMPs, B = Board-a-match (aka Point-a-board), T = Total points, X = IMP pairs (aka Cross-IMPs), M = Matchpoints, N = Instant matchpoints, R = Rubber bridge, C = Chicago, A = Cavendish (same as Chicago but second/third dealer nonvulnerable) or P = Plus-or-fishfood (my silliness for the side that goes plus wins; honors do not 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 R (Rubber bridge)
F C:NS 60 (Chicago, N-S have 60 partscore)
F A:no honors or partscore carryover

K = Team Names and Carryovers

Max len: 84  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 is North-South for the first of each pair of identical deals.

Optionally, this may be followed by a colon and carryover for Team 1; then another colon and carryover for Team 2. Carryovers may be IMPs, matchpoints or total points, depending on form of scoring. Fractional carryovers are allowed and must be expressed in hundredths (two decimal places). Negative carryovers are allowed and are useful to deduct a penalty assessed in the current segment (e.g., slow play). Examples:

K Nickell:Schwartz
K Italy:USA1:999:22 (Italy leads by 977)
K Meckstroth's Marauders:Rodwell's Rockets
K Iceland:Bulgaria:76.33:91.50
K France:Spain::-5 (Spain penalized 5)
K GIB:Jack:99-8 (GIB up 99 but penalized 8)

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. This may be followed by a second colon and the room (C = Closed, O = Open) or table number (1-250), and optionally a third colon followed by any other information. 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: (all)
The board or sequence number of the deal — usually just a plain number, but any notation is acceptable. Optionally, this may be followed by a separator (:) and a second number or notation, such as the section letter in a large tournament. Examples:

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

H = Hands

Max len: 71  Valid char: 23456789AEJKNQSTWx:.;?
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)
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 OK with my utilities, however, output files remove superfluous 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.

Pseudo Cards

Cards may be entered as 'x' to designate one of the lowest unassigned cards in that suit. My conversion utilities automatically convert 'x' cards to random real cards, since no other format allows them.

Cards may also be entered as '?' to designate an unknown rank. This might be useful for presentation purposes, but of course precludes any card play.

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. Also, the letter Y may be used as a query point (multiple times 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 WE:A (West deals, E-W vul, passed out)
A NB:1SXY (your call as South?)
A S?:1SP2CP:2D (unknown vul, call sequence)
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 be:

1 apparently lost his mind
Besides referenced comments 1-9, the A label may be followed by a general comment (0). For example:

0 N-S were a new partnership

C = Contract and Declarer

Max len: 24  Valid char: 0123456789CDEHMNRSWX:
The contract consists of level, strain, jeopardy and goal (in that order) but only the strain is required. Level is a digit (1-7); strain is a letter (CDHSN); jeopardy is a letter (XR); and goal is a number of tricks to win (1-13) or the letter M (maximum). Stating a goal is only necessary for endings (without a level) but is useful to show a true objective, as in a deliberate sacrifice bid.

Contract must be followed by a colon (:) and the declarer (NESW). If the first leader is not to the left of declarer (as for an ending) append a second colon (:) and the first leader (NESW).

C 5D:N (Five diamonds, North declarer)
C 6NR:E (Six notrump rdbld, East declarer)
C 4SX8:S (true goal to win 8 tricks)
C H6:S:S (Hearts win 6, by S and S leads)
C CM:W (Clubs win max, by W and N leads)

P = Play

Max len: 128 Valid char: 123456789ACDHJKQSTY:;+-~.!?*^
The play sequence in the exact order of cards played. Each trick begins with the lead and is followed by the second, third and fourth plays. Tricks are separated by a colon, or a semicolon to mean “plays that follow are unimportant or trivial.” The play can end at any time (including mid-trick); just stop writing.

Plays are shown by suit and rank, except when following to the suit led, then only the rank is given. This method not only saves keystrokes but should be the universal norm, as discards and ruffs stand out, making it easier to follow the play.

Any play may be followed by a notation: ! = good, ? = poor, !! = very good, ?? = very poor, !? = speculative, ?! = questionable, * = conventional (no explanation follows), ^1 = see note (1-9 allowed).

P SK54T:SA87H3:HA245:HKQ8J
P 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 be:

1 subtle falsecard
Besides referenced comments 1-9, the P label may be followed by a general comment (0) which I often use to summarize the play when curtailed. (The zero of course is only to comply with RBN format and would not be printed or displayed.) For example:

0 Lose 1 trump trick

Pseudo Plays

The ability to denote plays as insignificant can be useful. A minus sign (-) indicates the lowest unplayed card; so does a tilde (~) although the choice of suit is significant; a plus sign (+) means the highest unplayed card; and a dot (.) means an immaterial discard.

To illustrate, suppose I want to diagram the play of this suit, say spades: North A-J-8-4-3-2, South K-10-5, West Q-9-7-6 and East void. With South on lead the first two tricks would be:

P SK--.:STQA.
I could have written ‘62’ instead of the two minus signs, but as shown it conveys that these plays are insignificant (unlike the second trick). Poor East has no cards, so the dots represent his irrelevant discards. Note that to run this suit, I must return to the South hand in another suit to finesse again. Enter the suitless trick, which has three possibilities (-+--, --+-, ---+) with the plus sign denoting the hand relative to leader to which the lead will be transferred. Thus, the essential play of this suit can be fully described by:

P SK--.:STQA.:--+-:S578
Another pseudo play, analogous to the A (auction) label, is the letter Y to mean “Your play?” but it can only be the last play. This is useful for quizzes.

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.

M = Makes at Double-Dummy

Max len: 53  Valid char: 0123456789ABCD:+=!?
This label contains double-dummy analysis of the deal; more specifically, the number of tricks declarer can win with best play and best defense. Numbers are hexadecimal (A=10, B=11, C=12, D=13) so that all makes can be shown by a single digit. The M label is divided into four parts, separated by colons, as explained below.

Part 1: Number of tricks declarer can win in the given contract with best defense. Optionally this may be followed by the status after each lead in the P label thru trick 12. Each number represents the total number of makable tricks including past tricks; thus an increase means the defense erred, and a decrease means declarer erred. To save space, equivalent numbers may be truncated from the lead-status list; so if only a partial list is given it must be terminated with a question mark (?) to mean nothing further known. Examples:

M 9 (makes 9 tricks with best defense)
M 8998888788887 (complete play analysis)
M AA (10 best, 10 after each lead)
M 9A9 (10 after opening lead, 9 thereafter)
M 89? (9 after opening lead, unknown after)
Part 2: Number of tricks makable in the given contract after all opening leads, ordered high-to-low by suit then rank. Touching cards in the same suit are skipped; i.e., if leader’s spades are K-Q-9-3, the queen is omitted since the result must be the same as the king. As in Part 1, equivalent numbers may be truncated from the end, and a question mark (?) means unknown.

M :AAABBBAABA (makes of 10 different leads)
M :89 (8 after ranking lead, otherwise 9)
M :D (13 tricks with any lead)
M :77? (7 after two leads, others unknown)
Part 3: Number of tricks makable by North-South in each strain (assuming best defense without specified leads). North’s makes are given first, followed by a plus (+) sign then South. Makes consist of five numbers, one for each strain in ranking order (NSHDC). Unknown makes can be truncated or replaced with a question mark (?) as a placeholder. If South makes the same as North (usually true), replace the plus sign with an equal sign (=) and omit the duplicate list.

M ::987A8+997A8 (spades by South is better)
M ::BA69A= (same for either N-S declarer)
M ::9 (North makes 9 in NT, else unknown)
Part 4: Analogous to Part 3 but for West-East (West is given first to keep the left-right relationship). As a 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 for East and South.

M :::74499= (West shown, East makes same)
M ::987A8=:!= (North shown, all square)
M ::88666+88667:!! (West 55777, East 55776)
Note: In early RBN versions the M label had only three parts. The additional part now takes the second position (Part 2) in the colon-separated fields. Therefore, to adjust the old format to the new, an extra colon must be inserted after Part 1.

Incomplete Deals

The M label can be used on incomplete deals provided each player has the same number of cards. Make numbers relate to the diagram as given; e.g., in an eight-card ending the highest possible make is 8.

In Part 4 of the M label, the Not symbol (!) cannot be used (difference from 13 is assumed), so West’s makes cannot be abbreviated, and only an equal sign can abbreviate East’s.

I = Item List

Max len: 500  Valid char: (all)
This label can be used for any listing of the form [item]=[value]. Item can be a call, contract, lead, play, phrase, or a bridge score divided by 10.* Value can be an award, instant matchpoint score, description or definition. Multiple items are separated by a colon.

*Omitting trailing zeros saves space in a long list of scores, essentially undoing the lunacy of bloated bridge scores (multiples of 10) that Harold Vanderbilt forced upon us, obsessed by his millions.

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 whole percent. Corresponding E-W awards are simply the difference between the N-S award and 100. An item without an equal sign is a “gap award” between the score on the left and the score on the right. For example:

I 80=99:98:75=97:95:67=94:92:50=90…
Note the bare 98, 95 and 92, which are gap awards. Also note the implied front gap, i.e., any score above 80 (800) gets 100 percent. Similarly, any score worse than the last item (not shown) gets 0 percent.

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.

A more common use is to assign awards to various contracts, leads or play options. My practice is to use a 10-scale, though this is entirely up to the user. Listing order should be from best to worst.

I 3N=10:4S=7:6S=5:P=4:5S=3:4N=1
I SK=10:HK=9:H8=7:HT=4:D3=3:CK=2
I Win HA; lead SK=10:Win HA; lead H2=8…
Optionally, for readability, separators can be line breaks. In that case the I label ends with a double CRLF (end of record) or any line starting with a curly brace (free text). Further, the "I " can be omitted if the first item does not have a space as its second character. I found this useful for bidding system notes:

Dbl=0 or 3 key cards
Pass=1 or 4 key cards
Cheapest bid=2 or 5 key cards
TopMain

General Database Rules

Labels DTLESFKNBH are 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). Therefore, if one of these labels exists and then becomes unused, it must be explicitly set null using the label alone (without data) to stop the repetition.

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 others.

The remaining labels (ACPRMI) do not repeat and are presumed null unless explicitly designated.

Order of labels only matters for the I label (which must be last) and numbered notes (0-9) which must follow the appropriate A (auction) or P (play) label. All output files created by my RBN utilities order labels DTLESFKNBHACPRMI regardless of the input order. Numbered notes (if any) are placed immediately after the appropriate A or P label.

Letter case is immaterial for labels DHCRM; either upper or lower is accepted, though my utilities convert all output to uppercase. For labels TLESFKNBAPI case is usually significant and always preserved.

A space (ASCII 32) is required after each label, except null labels. Otherwise, spaces are allowed only in labels TLESFKNBI, which accept all characters. Spaces are not allowed in labels DHACPRM.

TopMain

File Signature and Limits

To be identified as an RBN file, the first line should 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 36 deals (c) 1989 rpbridge.net
% Instant awards, bidding and analyses
D 19890919
T Royal Viking Pairs:Richard Pavlicek
L Analyses 7N05
… etc.
Note that there is no blank line between extraneous text and the first label, as two CRLFs terminate a record. (Adding a blank line would result in an extra record with all null labels.) For the same reason, you cannot put blank lines in free text. Also note that the last record 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 record separation.

The maximum line length is shown for each label. Except for the I label (allowing 500) 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, 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 record-size restriction.

The maximum size of a single RBN record is 16,384 bytes. Obviously, this could only be approached by the inclusion of free text. To show how this relates, the “Florida Belles Are Ringers” article uses 2291 bytes, which is less than 1/7 of the limit. There is no limit on the size of an RBN file, except the DOS limit of 2 gigabytes, but that’s unlikely to be a concern.

TopMain

RBX Format

I have found it useful, especially for Internet files, to place each RBN record on a single line. Enter the RBX format, which replaces the space after each label with a left curly brace, and each line break (except the last) with a right curly brace. This creates a neat package for data processing.

For example, the following RBN record:

% RBN
D 19991225
L Timbuktu
E Teams
S F:1
F I
K Duck:Fox
N Bob+Ed:Tom+Joe
B 7
H W:AK2
A SB:1HP5H^1A
1 nuts
C 5H:S
{Ed quit!}
is equivalent to this RBX record:

%{RBX}D{19991225}L{Timbuktu}E{Teams}S{F:1}F{I}K{Duck:Fox}N{Bob+Ed:Tom+Joe}B{7}H{W:AK2}A{SB:1HP5H^1A}1{nuts}C{5H:S}{Ed quit!}
Note that all data is within {curly braces}, and the bare character before is the label or annotation digit (or % for extraneous text). If no bare character precedes bracketed data, it is a free text paragraph. If a line break occurs within free text, it is replaced by %n (two characters that should never occur together in text) to retain the single-line structure.

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 about 1/3 the size of an equivalent PBN file.

This edition (3.1) represents a reasonably finalized format, as only a few refinements have been made in the last 10 years of over 16 years in use. I think you’ll find it ideal for a bridge database. –Richard Pavlicek (richard@rpbridge.net)

TopMain

© 2016 Richard Pavlicek