Bridge Replay, Analysis and Hand Creation

Bridge Replay

Version 2026-01-11

My name is Rene Grothmann. I am an experienced Bridge player from Ingolstadt, Germany. I wrote this program because I could not find a similar one with the same features and ease of use. Enjoy, and contact me via email in case of questions or suggestions!

The homepage of this software is SourceForge. You can download the virus checked files from their server.

Content

  • Installation
  • Quick Start
  • Overview
  • Bidding Mode
  • Playing Mode
  • Replay Mode
  • Constraints for Deals
  • Double Dummy Analysis
  • File Formats
  • Menu
  • Hints for German Users

Installation

This program is a Java program and needs a Java Runtime Environment. You can download and install a current JRE from Oracle.

You should then be able to double click on the bridge.jar file that you downloaded from Sourceforge and start the program. If that does not work you can start the program from a command line, using the command

java -jar bridge.jar

You can make the start easier by creating a batch file and starting a reference to this batch file. I describe this process for Windows only. Start a text editor like Notepad and enter the text

start javaw -jar %USERPROFILE%\bridge.jar

I assumed that you downloaded the jar-file to "C:\users\yourname". Save the new text file under "bridge.bat". Double clicking this file should already start the program. You can now create a reference to "bridge.bat" with the right mouse button. Open the preferences of this reference and set it to open minimized. You can also select one of the icons for it.

Quick Start

After the start of the program, a new random hand will be generated, and the bidding will start. Only the current bidding hand will be visible. You can bid by clicking in the bidding box.

After three passes, the bidding ends and the playing starts. The contract is in the upper left corner, the number of tricks for each side in the upper right corner. Play by clicking the cards. You can hide other hands with Alt-H.

At any point, a replay can be started by pressing Ctrl-R, or by going backward with the left cursor key. Use the left and right cursor keys and the home or end key to move within the replay. Pressing Escape will discard the replay actions and continue bidding or playing at the current point.

You can save or load PBN or LIN files. After loading a file the replay will start at the beginning of the bidding. Pressing Ctrl-P at this point will discard the bidding and play and you see the full board. You will then be asked to enter a contract. If the file contains more than one hand, the program will ask which hand to load. Hands must be separated by empty lines.

LIN files can be saved by the double dummy solver in the net. The IntoBridge web site does copy a clipboard string containing the LIN format. The program can read and interpret that too.

There are numerous keyboard shortcuts for bidding and playing. Read the following sections for more information.

To export the hand into a blog, you can generate HTML output and open the browser. Then paste and copy a screen crop to your blog, or the content if your blogging software allows. The formatting uses DIVs. Only visible hands will be visible in the HTML output. So press Ctrl-P after loading a board with bids. Bids will display below the hand. Rotation will be in effect.

While bidding, there is an option to show two or all hands instead of just one. The current player will be shown with a question mark. To show only NS or EW, go to the bidding and deselect the option to show all hands while bidding.

There is also an HTML output which shows each hand in one line. The selection of the hands shown is controlled in the same way.

You can use double dummy analysis either by the web service provided by John Goacher. The program will start the web browser with an address line containing the bid and the play in LIN format.

For Windows 64, you can download a local version of the double dummy solver DLL by Bo Haglund and an interface to the DLL from my SourceForge project. In this case, the scores of moves can be displayed during play and replay, and a double dummy analysis of all best scores can be computed. You can also declare against opponents playing double dummy, or play as one of the defending opponents. You can enable a red flag if you play an error.

I am planning to write a double dummy solver in Java which would be included in the program code. Currently, the program is using the wonderfully optimized DLL by Bo Haglund. It is free to use and I include a version in the program package.

The Iconbar can be disabled. Note that some icons (Load, Save, Shuffle, DDS) are collective icons for the last action selected from the menu. All icons have tooltips which you see when hovering the mouse over the icon. The Play button will jump to playing if Autoplay is active.

Overview

This program has the following features.

  • Generate random hands with side conditions. These constraints can be entered by the user in a special syntax. There are also simple constraints restricting the combined N/S hands.
  • Load a PBN hand (Format of the Bridge Composer Program)
  • Save a hand in PBN format. This format will contain the bidding and play for the Bridge Composer.
  • Save and Load a hand in LIN format. This format can be imported to BBO and to the Double Dummy Solver. LIN board can also be extracted from the clipboard.
  • Bid and replay of the hand.
  • Call the Double Dummy Solver for the hand.
  • On Windows (64-bit), you can download and use the double dummy solver locally.
  • Autoplay other hands and get a red flag if your play was not optimal.
  • Save the hand in the LIN format. The double dummy solver can read the bidding and play from this format.
  • Read the bidding and play in LIN format from the clipboard, like IntoBridge pastes it.
  • Export hand to HTML and show in browser.
  • Analyze hands given by constraints by shuffling and showing the medians of achieved tricks, as well as the 1/3 median.

There are three modes which the program can be in.

  • Bidding: In bidding mode a bidding box is displayed and only the hand of the current player will be shown. You can click on the bids or use keyboard shortcuts. Each bid will be entered into a list of bids, and also into the list of replay actions.
  • Playing: In playing mode, all hands will be shown. You can click on any card to play it, or use keyboard shortcuts. The bidding can be displayed with key B. Each bid is entered into the list of replay actions.
  • Replay: In replay mode, the bidding and the play can be walked through in both directions using the list of replay actions. Small boxes in the lower corners indicate that you are in replay mode. If the file is saved in replay mode, replay will advance to the end of the auction to ensure that all bids are in the list of replay actions.

The interface of this program can be handled by mouse clicks alone. But power users can also enter bids and play cards using the keyboard. You can find the keyboard shortcuts in the menu or in this help file.

Note, that pressing the left cursor key will bring you into replay mode from bidding or playing. Forwarding to the end of the replay will bring you back to where you were before.

The double dummy solver in the Web is a friendly service by John Goacher with code from Jo Haglund. Calling it will pass the bid and the play. You can check each step in your play by selecting the contract and forwarding through the play.

For German users, the program can use suit shortcuts P, C, K, T, cards A, K, D, B, Z, and translate keyboard shortcuts. This mode is set with Alt-G or the command line argument "-g". Note that all letters can be entered in small caps. To avoid confusion with k(aro) the K(ing) is entered as a capital letter or with the letter G. German deal constraints start with the constraint "G".

The program will save a properties file when the window is closed. This file is named ".bridgereplay" and is located in the home directory of the user. Currently, the German state and the most recent constraint for the deal are saved in that file.

Bidding Mode

You will see the current hand and the bidding box. Click on the clickspots in the lower part of the box to place a bid, or use the keyboard shortcuts. Bids will be checked if they are legal. Double and Redouble is only shown if they are legally possible.

The bidding box can only show the last five rounds of bids. If you need to see older biddings, click at the upper edge of the box or press the up or down cursor key.

You can use the following keyboard shortcuts.

  • 1, 2, 3, 4, 5, 6, 7 : Selects the number of tricks.
  • S, H, D, C : Selects a suit.
  • N : Selects "No Trump"
  • P, - : Selects "Pass"
  • X, Y : Selects "Double", "Redouble"
  • Backspace : Take back one bid
  • Up, Down : Push the bids up or down to show hidden bids.
  • Left : Start Replay mode.
  • Ctrl-N : Add a note to the recent bid.

When the bidding is over, the program will automatically switch to playing mode, the declarer will be shown, and the leading hand will be marked.

Playing Mode

While playing, all hands are visible, unless "Hide other Hands" is enabled. The player to play the next card is indicated by a black rectangle around the hand label. Cards can be clicked with the mouse. Only legal cards can be played.

There are also the following keyboard shortcuts.

  • S, H, D, C : Plays the lowest card of the suit if that is legal.
  • A, K, Q, J, T, 9, 8, 7, 6, 5, 4, 3, 2 : Plays the card with that value. If there are multiple choices, the cards will be highlighted in cyan. The card can then be selected with the suit shortcut.
  • Backspace : Takes back the trick. This works only until 3 cards are played.
  • Return : Follows with the lowest card of the suit.
  • Left : Start Replay mode.

Replay Mode

In replay mode, the player can review the bidding and the playing of the hand. As an indication for this mode, small boxes will be displayed in the lower corners to indicate which direction of movement is possible.

By default, the replay mode shows all hands or the current hand only as selected in the options (Alt-H). It is possible to show only the South hand (or the hand rotated to the South position) and the table (Alt-S). The double dummy scores of each card can optionally be displayed (Ctrl-Alt-A).

Bidding notes found in PBN files can be seen during the replay of the bidding.

The bid that has been made by the currently selected hand is shown by default. This can be changed with an option.

To get to the replay mode, press Ctrl-R or use the menu. To exit the replay mode, press Ctrl-R again or use the menu. This will advance to the end of the replay and bidding or playing can be continued. It is also possible to exit the replay at the current position by pressing Esc or using the menu, and continue at this position. Further actions will be lost.

The best way to change a bidding or a card play is to press the left cursor key. This will enter replay mode. You can walk back a few steps and press Esc to continue at that position.

The following keyboard shortcuts can be used in the replay mode.

  • Cursor right : Advance forward in the replay.
  • Cursor left : Go backward in the replay.
  • Home : Go to the start of the replay (usually the bidding).
  • End : Go to the end of the replay.
  • Ctrl-R : Go to the end of the replay and continue playing or bidding.
  • Escape : Continue playing at this position. Further actions will be lost
  • Ctrl-P : Goes to the start of the card play.
  • Ctrl-N : Add a note or change the current note to the recent bid.

Clicking on the left or right hand side of the board display does also a move the replay back or forward.

Constraints for Deals

Hint: The dialog for constraints contains a text area to enter the constraints. You can use multiple lines with the Enter key. To exit the dialog press Ctrl-Enter, or TAB and the Space key. To abort, press Escape.

Simple constraints can be obtained by the menu items in the Deal menu. This will deal the N/S hands accordingly.

For more advanced constraints, you have to enter the constraints in a special syntax. The items in the constraints are strings separated by blanks. The following options are currently available. Capitalization does not matter, nor line breaks. For some constraints, we show only examples.

  • N:, E:, S:, W: applies the following constraints to these hands.
  • N:D additionally sets North as the dealer.
  • N:V or N:DV additionally sets N/S vulnerable.
  • >10, <10, =10, =10-13 tries to give the hand more, less, exactly 10 points, or between 10 and 13 points.
  • sAK987 sets the spade suit to specified cards.
  • sAK+2 sets the spade suit to specified cards plus two lower cards. Works also as "s+5", setting to 5 cards.
  • sAK>2 sets the spade suit to specified cards plus at least two lower cards
  • sAxxxx sets the spade suit to the ace plus four cards below the 10. Can be combines with "+2" and ">2"
  • sAYxxx sets the spade suit to the ace plus a high card honor plus three low card honors
  • N:=AKQT32.982..KQ32 sets the North hand exactly. There must be three dots to separate suits. If not all cards are specified they will be randomly selected. The dealer or vulnerability can be set in another N:DV constraint.
  • !S1NT sets the contract to South as 1NT.
  • G sets the constraints to the German card symbols and suits, like "pAKDBZxx"

Constraints are processed from left to right. Thus you should first fix cards in suits and then add a points restriction. You can fix suits in all hands, and after that restrict points for each hand, by repeating "N:" etc.

The constraints can be loaded from a file. This should be a text file with extension "txt". It can contain multiple lines. The recent constraints are also saved in the properties file of the application after the window is closed.

It is possible to load the current hand in the form of constraints and edit these constraints. To keep the North and South hands, you can alternatively just shuffle the East and West hands. But it would be possible to set a point count on East.

The Analyze button is explained at the end of the next section.

Double Dummy Analysis

Hands can be exported to the Double Dummy Solver by John Goacher in the Net. This service is provided by Bridgewebs. The bidding and the play, if available, will be exported too. You can replay the game on their site.

For Windows (64-bit), a local version of the Double Dummy Solver by Bo Haglund is available for download, as well as an executable to interface the DLL. You need to put both into the same directory as "bridge.jar". The analysis will be displayed in a separate frame.

With this interface, it is also possible to display the maximal scores for each card in play and replay. The result is shown relative to the contract. Green is for overtricks, black for making, and red for undertricks.

You can also play as declarer against opponents who will use double dummy analysis, or you can play as an opponent. After loading a game, of finishing a play, use the Play button to start playing. The Replay button will instead start the replay at the end of the bidding.

It is interesting to analyze or replay the hand with shuffled cards in the hands of the opponents. This can be achieved by a menu entry. The boards of the opponents of the declarer will be shuffled, and the contract will stay the same. If no contract was determined, the program will ask for a contract.

Of course, an alternative way to do such an analysis is to use constraints to fix N/S hands and the contract.

Another option is to show the error in play with a red flag in the upper right corner.

The program can repeat the complete analysis shuffling according to a given constraint. The default repetition count is 21. After the analysis, the median of the results for each contract are shown, as well as the 1/3 median. The latter shows the tricks which could be achieved in 2/3 of the repetitions.

One way to use this feature is to load the current hand as a constraint and delete or relax constraints. E.g., the E/W hands could be made unfixed. This would allow the analysis of various distributions of the the hand of the opponents.

File Formats

The most flexible and complete files for storing bridge hands and plays is the PBN standard. It is an open standard and you can find a good documentation in the net. It is used by various bridge programs in the net, e.g., the Bridge Composer, a payware program. The double dummy solver in the net can also save PBN files. This way, you can save BBO hands in PBN format.

BBO uses the LIN format. It is much more compact format. This format can be loaded by the double dummy solver. It is also used in the LIN parameter for the double dummy solver. Unfortunately the solver will ignore the bidding and the play in PBN files.

Bridge Replay can load and save PBN files. LIN files can only be saved, but the LIN format is used in the LIN parameter to call the double dummy solver.

Menu

File

  • Load a PBN File (Ctrl-L) : Loads a file in PBN format. This format is used and generated by the Bridge Composer. If the file contains a contract, the play will start.
  • Save a PBN File (Ctrl-S) : Save the hand in PBN format.
  • Load next Hand (Alt-Ctrl-L) : Load the next hand in the current PBN file, if there is one more hand.
  • Load a LIN File (Ctrl-I) : Load a hand from the undocumented LIN format.
  • Save a LIN File (Ctrl-I) : Save the hand in the LIN format.
  • Show in Browser (Ctrl-H) : Save the hand in the HTML format and open the default browser.
  • Load from Clipboard (Ctrl-V) : Load a hand in LIN format from the Clipboard (for Into Bridge).
  • Set Names (Ctrl-Alt-N) : Set the names of the players for HTML export.
  • Exit : Exits the program immediately. Closing the window will do the same.

Actions

  • Take Back (Backspace) : Take back one bid while bidding or one card while playing.
  • Add Note to bid (Ctrl-N) : A dialog will open for a note to the last bid. These notes will be saved with PBN files.
  • Web Solver (Ctrl-W) : Calls the double dummy solver in the Web.
  • Analyze Locally (Ctrl-A) : Calls the local double dummy solver for all maximal scores in all contracts. DDS.DLL and DDS.EXE is needed.
  • Rotate (Ctrl-R) : Rotate the boards clockwise.
  • Bid (Ctrl-B) : Start the bidding.
  • Play (Ctrl-P) : Start the playing again. In replay mode, this will move to the start of the play.
  • New Contract : Discard the bidding and playing and enter a new contract. The format is S1P, E2NT etc.

Replay

  • Toggle Replay (Ctrl-R) : This will move forward to the end of the replay and then return to the bidding or playing mode.
  • Continue Playing Now (Escape Key) : The replay will be abandoned at the current position and subsequent replay actions are lost. To regain the full replay, the board must be stored and reloaded.
  • Replay Forward and Back (Cursor right and left) : This will move in the replay. If the end of the replay is reached, playing or bidding will be resumed.
  • Replay to Start or End (Home or End key) : Moves to the start and end of the replay.

Deals

  • Random Hand (Ctrl-0) : Shuffle the board once for a random hand.
  • Strong Hand (Ctrl-1) : Shuffle the hand until the total points (combined in North and South) are greater than 25, at most 100 times.
  • Weak Hand (Ctrl-2) : Shuffle until the total points in N/S are less than 18.
  • Slam Hand (Ctrl-2) : Shuffle until the total points in N/S are more than 30.
  • Flat Hand (Ctrl-4) : Shuffle until there is no suit in N/S with more than five cards, and N/S has more than 22 points.
  • Distributional hand (Ctrl-5) : Shuffle until the sum of the two longest combined colors in North and South is greater than 16.
  • Hand with Constraints (Ctrl-6) : Enter constraints using a specified syntax as described above.

Options

  • Show Bids (Alt-B) : Show the bid while playing. Works also with the key B.
  • Hide other Hands (Alt-H)Hide non-active hands in play as at real tables.
  • Use German Suits and Cards (Alt-G) : Shows the cards as A, K, D, B. Moreover, the shortcuts for the suits are P(ik), C(eur), K(aro), T(reff). The 10 is Z. The capital key K can be used for King to avoid confusion with Karo during the play which is entered as small k. East shows as O.
  • Suit Order Diamonds-Clubs (Alt-O) : Shows the suits in the order of their rank. By default red-black is alternated.
  • Lage Font : This will need a restart to recreate the window menu.
  • Mark next played Card : On replay, the next played card gets a light gray background.
  • Small Bidding Box : Makes the bidding box larger or smaller.
  • SShow only one hand in Replay : During Replay, all hands are visible by default.
  • Names in HTML Export : If a hand is loaded from a LIN file or from IntoBridge via the clipboard, the players have names which are displayed in the HTML export.
  • Show double dummy Scores : This option will display the maximal scores of each possible card during play and replay. DDS.DLL and DDS.EXE is needed.
  • Autoplay as ... (Alt-1, Alt-2, Alt-P) : Selects the side which you play. The other players will autoplay with double dummy analysis.
  • Show Errors (Alt-E) : Shows errors you make due to double dummy analysis by a red box in the upper right corner.
  • Large Fonts : Makes the menu font larger.
  • Small Bidding Box : Makes the bidding box larger or smaller.
  • Toolbar : Toggles the toolbar at the left of the display.

Help

  • Show Help (F1) : Opens this help file, of course.

Hints for German users

It is a bit awkward for German users to remember the English names for cards and suits. Thus, the program can be set to use German (i.e. French) shortcuts.

  • P, C, K, T: German suits (Pik, Coeur, Karo, Treff).
  • A, G, D, B, Z: German cards (Ass, König, Dame, Bube, Zehn). The king is G to avoid confusion with Karo.
  • N, O, S, W: German hand names (Nord, Ost, Süd, West).

Constraints can be entered in German. You need to start the constraint with the letter G. This can be done automatically by a switch in the menu.

Sidebar Items

The sidebar contains shortcuts to items in the menu. Some items use the corresponding menu item that was use last. Refer to the menu description for details.

  • Load : Load from file (PBN or LIN as used last).
  • Save : Same from file (PBN or LIN as used last).
  • HTML : Saves in HTML and opens browser (Ctrl-H).
  • Insert : Reads a deal from the clipboard (Ctrl-V).
  • Take Back : Takes back one action (Backspace).
  • Escape : Escapes from Replay mode to Play mode (Escape).
  • Bid : Go to bidding mode or go to bidding in Replay (Ctrl-B).
  • Replay : Go to Playing mode or replay in Replay mode (Ctr-P).
  • Shuffle : Shuffle the board (as shuffled last in the menu) and start bidding.
  • Show Bids : Show the bidding (Ctrl-B).
  • DDS : Call DDS Analysis locally (or in the Web, if last used).
  • Play Scores : Toggle DDS Analysis of cards to play.
  • Autoplay : Toggle Autoplay.
  • Errors : Toggle showing Errors.
  • Hide : Toggle hiding other hands.
  • Show One : Toggle showing only one hand in Replay.

No comments:

Post a Comment

High there! Looking forward to hear from you.