gamesmathematical programsotherabout author

Bridge studio

ru

Introduction

Bridge studio is fast and powerful solver of bridge double dummy and preferans problems. This program is freeware with open source code. The basic features are

Screenshots

Click on pictures for enlargement

Solution for all declarers and trumps

Bridge Studio could be useful for competitions and commentators. First it can find optimal contract for every pair north/south and east/west. The second it can estimate number of tricks for every card for example best attack turn. Consider sample bridge hand which was dealt on competition.

North
J 5 4 3
Q J 8 2
-
Q J 8 5 2
West
T 9
7 6 5
T 9 7 5 4
7 6 3
East
A K 7 6 2
K 9
A Q
A K T 4
South
Q 8
A T 4 3
K J 8 6 3 2
9

Each player can be declarer and he/she can bid any suit or no trump game. The solver can calculate how many tricks every side can take at any trump and every declarer. For example if south bid NT game then pair north/south will take six tricks, if he bid clubs then pair take only five tricks. So we can create a table with tricks under optimal game for every declare and every suit+NT.

Tricks chart

trump
NT
d
e
c
l
a
r
e
r
north69566
east74887
south68556
west74777

Next we can create table of achievable contracts for every declarer and every suit+NT and best contracts table.

Achievable players contracts

trump
NT
d
e
c
l
a
r
e
r
north-3---
east1-221NT
south-2---
west1-111NT

Best contract levels

north 3
east1 2 2 1NT
south 2
west1 1 1 1NT

Now consider how solve option is working for preferans game.

Preferans

Let's take one of well known preferans problem which is called "Mizer of Kowalevskaya".

North
10 9 8 7
9 8
9 8 7
8
West
Q J
J 7
A K Q 10
9 7
East
A K
A K Q 10
J
Q J 10

In preferans game player who do a very first move is not strictly depends on declarer. So when program solves problems for all declarers and trumps it fixes player which do very first turn. In case of preferans game we have three players and four possible trumps or NT game or mizer game. So totally we have to solve 18 problems.

Tricks chart

trump
NTmizer
d
e
c
l
a
r
e
r
north000002
east5959610
west314140

Next we can create table of achievable contracts for every declarer and every suit+NT and best contracts table.

Achievable players contracts

trump
NTmizer
d
e
c
l
a
r
e
r
north------
east-9-96NT-
west-----+

Best contract levels

north-
east9 9 6NT
westmizer

Interface language

By default language of the interface is english. There are english, russian, italian languages available at the moment. You can manipulate by the language using Options/load language file submenu. Language is stored in special lng file which has simple format. So if you want to add new language please create your own lng file and send it me.

Note. Current language will be stored automatically on exit.

Browse pbn and deep finesse files

The solver has feature load the problems from pbn (portable bridge notation) or deep finesse files. Pbn format is the international standard for bridge notation. Usually pbn file includes several double dummy problems. If you'll browse pbn file the solver show you dialog panel which includes number of the problems in the file. The dialog has first/last next/previous buttons for navigation. Current problem is showed in the main window. Chose the problem which you want to solve and close the dialog.

Setup new problem

To setup new problem select menu item Problem/New or press Ctrl+N. After it all of the cards will be on the West. Now click on the cards which you want to move to the north. When north will have 13 cards click on the cards which you want to move to the east. Finally click on the cards which you want to move to the south. If you click on the card which has north, east or south then card will move to the west. As well you can drag the cards to north, east, south or to the absent region. After it setup trump or non-trump game by clicking on the picture of trump and player who will make first move by clicking on the arrow on the table. If the first move already have done then drag current card to inner rectangle. An arrow in the inner rectangle will show on the next player. You can do the second move etc.
Note. It's possible to setup the problem where each player have 1..13 cards. For example each player can have 8 cards or it's possible to setup double dummy problem with no first very first turn.
If you press ctrl+left mouse button then the card move to the player to whom you move last card. Let you need drag cards 2 3 9 10 6 to north. You can drag every card to north, but it's possible to do it easier. Drag 2 of spades to north, after point to 3 of diamonds and press ctrl+left mouse button. 3 will go to north. The same you can do with other cards.

Problem analysis

Press button or click right mouse button to find best move. The solver will show you best move, number of tricks for each side if they will play optimally. Now you can press or right mouse button second time or do the move yourself, by dragging the card from current player to inner rectangle. You can undo the moves, just click on the inside card. One can undo several moves by clicking on the not very last card. There are helpful buttons undo all, undo, redo, redo all.

Problem edit

One can change all problem parameters such as trump, card position in the middle of the game. Press menu problem/edit problem or Ctrl+E. After it you can move cards, change trump and first turn.

Save/Add problem to html file

This option is useful for publication problems in the internet, and for printing. It's possible to store problem with or without pictures.

problem102
trump
saved by bridge studio
North
A 8 5 4
A 7 6 5 4 3
2
3 2
WestEast
Q J 7 6 -
-  7 K Q J 10 9 8
K Q J 10 9 8 7
K Q J 10 9 8 A 6
South
K 10 9 3 2
2
A 6 5 4 3
5 4

When the solver stores the problem it adds html-tag <p> to file, for example, for this problem it's add <p id=102> to html file. So you can refer to task. You can store the problem with best move and/or number of tricks in optimal game. Below you can see the same problem, but stored with best move and number of tricks.

problem102
trump
best move 3
tricks8/5
saved by bridge studio
North
A 8 5 4
A 7 6 5 4 3
2
3 2
WestEast
Q J 7 6 -
-  7 K Q J 10 9 8
K Q J 10 9 8 7
K Q J 10 9 8 A 6
South
K 10 9 3 2
2
A 6 5 4 3
5 4

Note. If you store the problem with best move or with number of tricks then you should wait until program find best move. It can take some time.

To store more than one problem to one html file you should use menu item problem/add problem to html file and select required html file.

Html converter

One can convert library of pbn, deep finesse, bts, pts files to html. It's useful when you want to store hand or library to html file. To do it select menu problem/html converter next select files which you want to convert to html. One can select any number of files which you want to convert. Click OK button.

Estimate all turns

This feature is very useful for problem analysis. The option is in option menu and has five possibilities.

Autoplay modes

One can setup autoplay mode using menu options.

Bridge/preferans

To switch from bridge to preferans and vice versa use menu problem/bridge or problem/preferans
Note Game type automatically saved under exit.

Versions history

version 4.0 22 december 2014

source code is rewrote for gcc compiler and crossplatform library gtk+, IDE is Eclipse CDT
add solution for all possible trumps and declarers
add problem rotation
add special support for small monitors
application is easy configurable (bridge.cfg became text file, bridge.css is also text file)
add font selection
html converter now supports drag & drop option
improve sequence detection for autoplay on sequence option

version 3.01 20 september 2012

setup font color manualy
setup card indent inside suit manually

version 3.0 11 september 2012

fixed bug with window size on windows Vista
fixed bug with LastTrick and Status windows placement for Windows Vista and Windows 7
added file association (bts,pts,pbn)
fixed bug with cursor capture
fixed bug with editing problem description
some flickers were removed
fixed bug with corners of cards
improve storing of html files
add italian language
add check that file with problem from library already exists
click on any player name in preferans to change player
click on any arrow rectangle to switch first turn (bridge+preferans)
remove many pictures (this produce shadows for some windows versions)
remove a lot of other bugs :)

version 2.23 8 february 2012

code is adopted for gcc compiler
small memory leak fixed
update mechanism is improved

version 2.22 17 may 2011

change saving type of html from unicode to image
add saving type of html without images
remove local references for pictures

version 2.21 5 february 2011

version 2.20 2 december 2010

version 2.19 10 june 2008

version 2.18 26 april 2008

version 2.17 13 december 2007

version 2.16 16 august 2007

version 2.15 30 july 2007

version 2.14 17 july 2007

version 2.13 4 july 2007

version 2.12 31 may 2007

version 2.11 30 march 2007

version 2.10 14 march 2007

version 2.9 9 december 2006

version 2.8 31 october 2006

version 2.7 1 october 2006

version 2.6 7 february 2005

version 2.5 4 november 2003

version 2.4 3 september 2003

version 2.3 18 july 2003

version 2.2 1 july 2003

version 2.1 16 june 2003

version 2.0 2 june 2003

version 1.2 28 april 2003

version 1.1 5 february 2003

version 1.01 16 january 2003

version 1.0 15 january 2003

History of preferans problem solver

At first program could solve only preferans problems. After the third version was issued I started to develop solver of both bridge and preferans problems.

version 3.0 13 july 2002

version 2.2 25 june 2002

version 2.1 7 june 2002

version 2.0 1 june 2002

version 1.1 20 may 2002

version 1.0 7 may 2002