Describing hands

How to tell the simulator what you know about each seat.

There are three ways to fill in a seat, and you can mix them freely across the four boxes. Leave a seat empty and it takes any hand at all.

1. A hand you can see

Type it out, suits in the order spades, hearts, diamonds, clubs, separated by full stops. A void is just nothing between two stops.

AQ543.K92.AJ.QT8 that exact hand
.KQ98763.AK52.J4 a void in spades — note the full stop at the start, with nothing before it

Underneath the box you will see the hand drawn out with suit symbols. If it does not appear, you have the wrong number of cards or a stray character.

2. A hand with the small cards unspecified

Often the spot cards do not matter. Two characters stand in for them:

xany card from the ten down to the two
*any card from the jack down to the two, drawn at random, so the jack turns up as often as it really would
AKxxx.Qxx.Jx.xxx those honours, everything else small

Honours can be typed in either case, which is easier on a phone: akxxx.qxx.jx.xxx is the same hand, and so is a full hand written that way.

2a. Only the suits you care about

Write # for a suit to leave it open — neither its length nor its cards given. KJx.#.#.# is the king, the jack and a spot in spades, with the other ten cards dealt from the remaining forty-nine.

A template like that can be followed by a description, separated by a space: KJx.#.#.#  h5m8M10 is five or more hearts and 8–10 points in all, the four points in the spades included.

Anything the template has already settled is refused rather than ignored, so KJx.#.#.#  s4 is an error: the spades are given. Whole hand shapes are allowed if the template can still reach them — :m is fine with the minors open, :b is not, because it needs five spades.

3. A description rather than a hand

This is the useful one. A description is a run of letters and numbers with no spaces. A lower case letter sets a minimum, an upper case letter a maximum.

m15M17b90 15-17 hcp and suit-length product at least 90
h6H6m5M9u60 exactly 6 hearts and 5-9 hcp and suit-length product at most 60

Whatever you type, the line underneath tells you what it actually means. If that line does not say what you had in mind, change it until it does — that is what it is there for.

The letters

LetterMeaning
s Sfewest / most spades
h Hfewest / most hearts
d Dfewest / most diamonds
c Cfewest / most clubs
m Mfewest / most high card points
a Afewest / most aces
l Llower / upper bound on losing tricks. Only useable where a fit has been diagnosed. At most three in a suit: start from twelve and take one off for any ace, for any king in a suit of two or more, and for any queen in a suit of three or more
b usuit-length product, at least / at most. On their own b means balanced and u unbalanced, which is the same as b90 and u80
Qa good suit: Q0 spades, Q1 hearts, Q2 diamonds, Q3 clubs
x Xfewest / most stops in a suit. Two digits, suit then count: x01 is at least one spade stop
t Tthe suit is headed by at least / at most a given card. Two digits, suit then 0 ace 1 king 2 queen 3 jack 4 a ten or lower
z Zat least / less than Qx in a suit. z2 means the diamonds are Qx, Kx or Ax, or three cards or more whatever they are
o Osix or more of a suit with no four card side suit: o1 is a one-suited heart hand
f Fat least / at most a given fit with partner. Two characters, the suit then the count, where A to D stand for ten to thirteen: f09 is a 9+ card spade fit, F18 at most eight hearts between you
r Rat least / at most a number of keycard points between you and partner in a suit: each ace 2, the king of the suit 2, its queen 1, so 0 to 11. Two characters, the suit then the count, where A and B stand for ten and eleven: r06 is at least three spade keycards, r1B all five with the ♥Q
v Va control / no control in a suit — a void, a singleton, the ace or the king: v0 is a spade control, V1 is two or more hearts without the ace or king
i Iholds / does not hold a particular card, given as a rank and a suit in either order and either case: iAH and iha both mean the ♥A, IDa is without the ♦A
wthe quality of a suit of six cards or more, graded by how many losers it expects opposite a small singleton: the suit then a band — 0 solid, 1 semi-solid, 2 strong, 3 decent, 4 fair, 5 weak, 6 anaemic, for fewer than 0.4, 1.2, 2, 2.7, 3 and 3.58 expected losers, and more. w12 is strong hearts, six or more of them; w01|w02 is semi-solid or strong spades. The losers are counted over every split of the missing cards, with partner's singleton led and covered as cheaply as a jack or better allows, then the suit played from the top
:five-five or better in two suits. Either a suit to leave out — :0 55+ outside spades, :1 outside hearts, :2 outside diamonds, :3 outside clubs — or a pair by name: :M majors, :m minors, :r red, :b black, :p pointed, :o rounded
y Yis / is not a named whole-hand shape. y0 is a set of shapes that fit a Precision 1♦ in a style where it might include a 4405, y1 is 5+ spades and spades≥hearts, y2 is 5+ hearts and hearts>spades

Suits are numbered 0 spades, 1 hearts, 2 diamonds, 3 clubs.

Fits and keycards are different. Each is a property of two hands, so it cannot be judged until both have been dealt. It does not matter which of the two seats states it, and it can be mixed with anything else, including alternatives and !: s7|f09 is seven spades of your own or a nine card fit between you, and f09! is anything but a nine card fit.
Counting losers. Take ♠AQ43 ♥K8 ♦QJ752 ♣93. The spades are four cards, so three count, and the ace and queen are there: one loser. The hearts are a doubleton, so two count and the king is one of them: one loser. The diamonds are five, so three count and only the queen is there: two losers. The clubs have nothing: two losers. Six in all, so l0L6 would keep this hand and l0L5 would not.
Suit-length product multiplies the four suit lengths together. A 4432 gives 4×4×3×2 = 96, a 5431 gives 60, a 7411 gives 28. So b90 keeps only balanced hands and u60 only shapely ones. It is a quick way to say “flat” or “wild” without listing shapes.

Joining conditions

Everything is joined by “and” unless you say otherwise.

|or
.everything before this must hold, whatever follows
!reverses what has been said so far
s5m12.h4|d4 at least 5 spades and at least 12 hcp, and then at least 4 hearts OR at least 4 diamonds
m12M14!.m18!. not (12-14 hcp), and not (at least 18 hcp)

That second one is the pattern for ruling a hand type out: write the thing you want to exclude, then !.

Some worked examples

m15M17b90 a strong notrump
h6H6m5M9u60 a weak 2 in hearts with a singleton or void
m16M18a3 16-18 with at least three aces
c6Q3t30m11 at least six clubs headed by the ace, a good suit, 11 or more
s5h5m11M15 five-five in the majors, 11-15

Ask for something impossible — s4h4d4c4 needs sixteen cards — and you get an error when you run it rather than a wrong answer.

Filling in the rest

Changing the vulnerability

The solver returns a trick count for each deal, and everything after that is arithmetic. So the deals and the solved strains are kept between calls, and changing the vulnerability rescores what is already in hand rather than dealing and solving again. On a five hundred deal run it takes a few hundredths of a second instead of fifteen seconds.

The Advanced page does the same: the vulnerability sits in the spec, but it changes nothing about the cards, so switching it rescores what is in hand. The same applies to dropping a contract, or swapping one for another at a different level in a strain already solved. Only a new strain, or a change to the hands or the deal count, costs anything. Pressing Deal and solve always deals afresh.

Taking the deals away

Under the results on the Contracts and Opening leads pages is a button to download the run as a CSV. Contracts gives one row a deal: all four hands, each hand’s point count, and then the tricks and the score for every contract. Opening leads gives one row a deal and lead, since which cards can be led changes from deal to deal.

Nothing is solved again to produce it. The module keeps the trick count for every deal, so the file is written straight out of what the run already knew.

The Why chart, three ways

With the Why control set to a seat, the chart under the results breaks the scores down by that hand’s point count. Where there are exactly two contracts it can also show the IMP or matchpoint margin at each point count, chosen with the buttons above the chart. The heading names the vulnerability the figures were solved at.

Note that these are margins, one contract against the other, not the par-relative figures in the table above: the two lines mirror each other and the crossing is the point count where the decision turns over. They need a head to head comparison, so they are offered only with two contracts. With three or more there is a mixture to solve, possibly with a cycle in it, and no single figure belongs to a point count.

Hand evaluation

A fourth page asks a narrower question: given partner’s range and mine, is the lower call or the higher one better? It answers twice. First across my whole range, which is what to do if I always chose the same. Then hand by hand, holding one of my hands fixed and varying partner.

The second table is sorted, so the hands wanting the higher call sit at the top and the rest at the bottom, with a heavy line where the answer changes. The hands either side of that line are the ones worth learning.

Lessons

The Lessons page works through one spot at a time. The first is this: partner has raised your hearts to two showing 6–9 and three-card support, you hold a balanced fifteen to eighteen with five hearts, and the question is whether to bid the game.

Type a hand, or tap one of the examples, and it shows the arithmetic rather than a verdict: what the point count alone says, then what each suit is worth beyond that, and the total in IMPs. The numbers come from thirty-two thousand deals solved double dummy. Outside that shape and range it says so rather than guessing.

Why

On the Contracts page, open Why and pick a seat whose constraint sets a point range. The scores are then plotted against that hand’s point count, one line a contract, so you can see where one call overtakes another rather than only which wins on average.

The figure under each point count is how many deals fell there. A hollow marker means fewer than ten, so treat it as a hint rather than a number.

What this records

When a solve finishes, the app sends how long it took, how many deals were asked for, and a rough description of the device: the number of processor cores, whether it is a phone, and the browser's major version. That is all.

There is no account, no cookie and no identifier of any kind, and your address is not stored. The only reason for collecting it is to find out how slow the app is on real phones, which is hard to judge from my own. To stop it sending anything, run this in the browser console:

localStorage.setItem("bidsolver.v1.notelemetry","1")

Credits

The double dummy solving is done by DDS, by Bo Haglund and Soren Hein — the solver behind most of the double dummy analysis you will have seen elsewhere. It is used unmodified, compiled to WebAssembly so that it runs on your own device.

DDS is copyright © 2006–2014 Bo Haglund and © 2014–2018 Bo Haglund and Soren Hein, and is licensed under the Apache License 2.0. A copy of that licence is included here: dds-LICENSE.txt.

Everything else — the hand generator, the constraint language, the scoring and the game theory — is my own.