Bridge Training

Game Modes

Teaching modes and their CoreConfig — one section per mode listing only the properties that differ from the base config.

The TeachingMode and CoreConfig types come from @workspace/bridge/types. The configs themselves are internal: a config depends on the mode, so it is only reachable through the engine built for that mode.

A TeachingMode is one of twelve string values: auction, sequence, show-trump, show-trump-goal, show-contract, no-auction, no-dummy, h, hd, hld, tht, petit-bridge. The engine resolves the mode from BridgeContext.teachingMode and exposes the resulting CoreConfig as engine.hands.config; the derived flags are on engine.ctx.

game-modes.ts
const configFor = (teachingMode: TeachingMode): CoreConfig =>
  createBridgeEngine(createBridgeContext({ teachingMode })).hands.config;

configFor("petit-bridge").nbCardsPerHand; // => 10
configFor("tht").honorMetric; // => "tht"

// A raw stored value is parsed first; unknown values take the default mode.
const stored = parseTeaching("unknown") ?? DEFAULT_TEACHING_MODE; // => "auction"
configFor(stored) === configFor("auction"); // => true

A stored mode is a raw string: parse it with parseTeaching and fall back to DEFAULT_TEACHING_MODE ("auction", the base config) before building the engine.

CoreConfig

Prop

Type

auctions takes an AuctionMode ("trump", "goal", "contract", "sequence", "interactive") or false. Leaving it undefined means a full interactive auction; no shipped config sets "interactive" explicitly.

Base config

The auction config is the reference every mode extends.

PropertyValue
nbCardsPerHand13
validRanksA K Q J T 9 8 7 6 5 4 3 2
variant"classic"
validDenominations["C", "D", "H", "S", "NT"] (DENOMINATIONS)
cardSet"standard"
auctionsundefined (full interactive auction)
dummyVisibleundefined (dummy visible)
playContextInfos["lead", "scoring", "sequence"]
suitDisplayOrderShared implementation (this-bound, honours imposedSuitOrder)
userPicksContract, showPartnerHandDuringAuction, honorMetric, imposedSuitOrderundefined
game-modes.ts
const base = createBridgeEngine(
  createBridgeContext({ teachingMode: "auction" })
).hands.config;
base.nbCardsPerHand; // => 13
base.auctions; // => undefined (full interactive auction)
base.validDenominations; // => ["C", "D", "H", "S", "NT"]
base.dummyVisible; // => undefined (treated as visible)
base.playContextInfos; // => ["lead", "scoring", "sequence"]

Derived axes per mode

The engine never branches on the mode name. It derives these axes from the config (see Engine):

ModeauctionInputcontractDisplaycontract sourcehasInteractiveAuctiondummyVisible
auction"sequence""full""auction"truetrue
sequence"sequence""full""auction"true (isObservation)true
show-trump"trump""trump""auction"falsetrue
show-trump-goal"trump""trumpGoal""auction"falsetrue
show-contract"contract""full""auction"falsetrue
no-auctionnull"hidden""none"falsetrue
no-dummynull"hidden""none"falsefalse
h, hd, hld, tht"contract""full""user"truetrue
petit-bridgenull"hidden""none"falsetrue

Modes

auction

Full interactive auction, standard deck. Base config, no overrides. The contract emerges from the bidding and is displayed in full.

sequence

Same as auction, but the sequence is scripted in the editor and replayed to the learner (engine.ctx.isObservation is true).

PropertyValue
auctions"sequence"

show-trump

No bidding. The author picks a trump suit, shown without a trick goal.

PropertyValue
auctions"trump"
playContextInfos["lead", "trump"]

show-trump-goal

No bidding. Trump suit and target trick count are shown.

PropertyValue
auctions"goal"
playContextInfos["lead", "trump", "objective"]

show-contract

No bidding. The author sets the full contract, which is displayed as such.

PropertyValue
auctions"contract"
playContextInfos["lead", "contract"]

no-auction

Standard deck, auctions disabled. Nothing about the contract is shown; the learner discovers it through play.

PropertyValue
auctionsfalse
playContextInfos["lead"]

no-dummy

Like no-auction, with the dummy hidden too.

PropertyValue
auctionsfalse
dummyVisiblefalse
playContextInfos["lead"]

h

Minibridge, No Trump only. The learner picks the contract at a selector after seeing the partner hand; the contract and goal are displayed.

PropertyValue
auctions"contract"
validDenominations["NT"]
userPicksContracttrue
showPartnerHandDuringAuctiontrue
playContextInfos["lead", "contract"]

hd / hld

Same as h with every denomination available.

PropertyValue
auctions"contract"
userPicksContracttrue
showPartnerHandDuringAuctiontrue
playContextInfos["lead", "contract"]

tht

Identical to hld, except the partner-hand pill shows Total Top-Honor-Tricks (A = K = 1, Q = ½) instead of HCP. Read the unit from engine.ctx.honorMetric and index engine.stats.honorComputers with it.

PropertyValue
all hd / hld overrides—
honorMetric"tht"
game-modes.ts
const tht = createBridgeEngine(createBridgeContext({ teachingMode: "tht" }));
tht.ctx.honorMetric; // => "tht"
tht.stats.honorComputers[tht.ctx.honorMetric]; // computeHandTHT

petit-bridge

40-card deck (ranks 2, 3, 4 removed), 10 cards per hand, no auction, no trump, its own card set and a fixed suit reading order (♥ ♣ ♦ ♠).

PropertyValue
nbCardsPerHand10
validRanksA K Q J T 9 8 7 6 5
variant"petit-bridge"
auctionsfalse
validDenominations[]
cardSet"petit-bridge"
imposedSuitOrder["H", "C", "D", "S"]
playContextInfos["lead", "objective"]
game-modes.ts
const engine = createBridgeEngine(
  createBridgeContext({ teachingMode: "petit-bridge" })
);
engine.hands.config.nbCardsPerHand; // => 10
engine.hands.config.auctions; // => false
engine.ctx.cardSet; // => "petit-bridge"
engine.ctx.contractDisplay; // => "hidden"

In petit-bridge, ranks display as numbers 1–10 regardless of locale (engine.notation.formatRank, see Notation):

Standard rankAKQJT98765
Display10987654321