Documentation
¶
Overview ¶
Package bridge is minimal contract bridge (docs/PLAN.md §3, decision 14): WOPR bids all four hands by point count, the player's side always declares (the table turns when East and West hold the cards), and the player plays both declarer's hand and dummy's while WOPR defends. One deal is one game: making the contract wins it.
Index ¶
Constants ¶
const Opening = 12
Opening is the fewest points that open the bidding.
Variables ¶
var Lines = []script.Ls{
lineRules, linePassedOut, lineTurned, lineAuction, lineContract, promptHand, promptDummy, lineNotHeld, lineFollow,
linePlayHelp, lineFinish, lineLeads, linePlays, lineTrick, lineMade, lineDown, callPass, strainNames, seatNames, panelTitle, panelContract,
panelTricks, panelDummy, panelLast, panelTaken, panelToPlay, panelVoid, artTitle,
}
Lines is every script block, for the provenance test.
var Pass = Bid{}
Pass is the call that bids nothing.
Functions ¶
func Auction ¶
Auction runs WOPR's bidding for all four seats, starting with dealer. The partnership that holds more points (dealer's side on a tie) declares, if one of its players can open: that player bids one of the target strain, partner raises to the target, and everyone else passes. With no opening hand at the table, the deal is passed out. It returns the calls in order and the contract (ok is false when passed out).
Types ¶
type Bid ¶
Bid is a call in the auction. Level 0 is a pass.
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game is bridge as a proto.Program.