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.
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"); // => trueA 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.
| Property | Value |
|---|---|
nbCardsPerHand | 13 |
validRanks | A K Q J T 9 8 7 6 5 4 3 2 |
variant | "classic" |
validDenominations | ["C", "D", "H", "S", "NT"] (DENOMINATIONS) |
cardSet | "standard" |
auctions | undefined (full interactive auction) |
dummyVisible | undefined (dummy visible) |
playContextInfos | ["lead", "scoring", "sequence"] |
suitDisplayOrder | Shared implementation (this-bound, honours imposedSuitOrder) |
userPicksContract, showPartnerHandDuringAuction, honorMetric, imposedSuitOrder | undefined |
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):
| Mode | auctionInput | contractDisplay | contract source | hasInteractiveAuction | dummyVisible |
|---|---|---|---|---|---|
auction | "sequence" | "full" | "auction" | true | true |
sequence | "sequence" | "full" | "auction" | true (isObservation) | true |
show-trump | "trump" | "trump" | "auction" | false | true |
show-trump-goal | "trump" | "trumpGoal" | "auction" | false | true |
show-contract | "contract" | "full" | "auction" | false | true |
no-auction | null | "hidden" | "none" | false | true |
no-dummy | null | "hidden" | "none" | false | false |
h, hd, hld, tht | "contract" | "full" | "user" | true | true |
petit-bridge | null | "hidden" | "none" | false | true |
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).
| Property | Value |
|---|---|
auctions | "sequence" |
show-trump
No bidding. The author picks a trump suit, shown without a trick goal.
| Property | Value |
|---|---|
auctions | "trump" |
playContextInfos | ["lead", "trump"] |
show-trump-goal
No bidding. Trump suit and target trick count are shown.
| Property | Value |
|---|---|
auctions | "goal" |
playContextInfos | ["lead", "trump", "objective"] |
show-contract
No bidding. The author sets the full contract, which is displayed as such.
| Property | Value |
|---|---|
auctions | "contract" |
playContextInfos | ["lead", "contract"] |
no-auction
Standard deck, auctions disabled. Nothing about the contract is shown; the learner discovers it through play.
| Property | Value |
|---|---|
auctions | false |
playContextInfos | ["lead"] |
no-dummy
Like no-auction, with the dummy hidden too.
| Property | Value |
|---|---|
auctions | false |
dummyVisible | false |
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.
| Property | Value |
|---|---|
auctions | "contract" |
validDenominations | ["NT"] |
userPicksContract | true |
showPartnerHandDuringAuction | true |
playContextInfos | ["lead", "contract"] |
hd / hld
Same as h with every denomination available.
| Property | Value |
|---|---|
auctions | "contract" |
userPicksContract | true |
showPartnerHandDuringAuction | true |
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.
| Property | Value |
|---|---|
all hd / hld overrides | — |
honorMetric | "tht" |
const tht = createBridgeEngine(createBridgeContext({ teachingMode: "tht" }));
tht.ctx.honorMetric; // => "tht"
tht.stats.honorComputers[tht.ctx.honorMetric]; // computeHandTHTpetit-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 (♥ ♣ ♦ ♠).
| Property | Value |
|---|---|
nbCardsPerHand | 10 |
validRanks | A K Q J T 9 8 7 6 5 |
variant | "petit-bridge" |
auctions | false |
validDenominations | [] |
cardSet | "petit-bridge" |
imposedSuitOrder | ["H", "C", "D", "S"] |
playContextInfos | ["lead", "objective"] |
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 rank | A | K | Q | J | T | 9 | 8 | 7 | 6 | 5 |
|---|---|---|---|---|---|---|---|---|---|---|
| Display | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |