Add Contract Bridge: auction, dummy play, and rubber scoring
New cg-bridge.el: a four-handed Bridge game (you are South, partnering North against East and West) on the shared cg-game base. * Auction: level/strain bids plus pass, double, and redouble, with the three-pass end rule, pass-outs, doubling state, and declarer determination (first of the side to name the strain). * Play: follow-suit with the dummy exposed after the opening lead; the declarer plays both hands. Trick resolution honours trump and no-trump. * Scoring: classic rubber -- trick points below the line toward game; overtricks, slam, insult, and undertrick penalties above; vulnerability and the rubber bonus. Verified against known results. * A small natural bidding AI (openings, NT, raises with a fit, simple overcalls) that always terminates the auction, plus a greedy card-play AI. Wire cg-bridge into the chooser, the Makefile, and the README, and add two ERT tests (scoring math and a dozen full AI-driven deals). The suite is now 109/109 and every file byte-compiles cleanly.
This commit is contained in:
parent
905d5989c2
commit
09adcaa3ea
5 changed files with 780 additions and 2 deletions
|
|
@ -105,6 +105,12 @@ with its command.
|
|||
- ~cg-spite~ -- Spite & Malice. Race the computer to empty your goal
|
||||
pile onto shared centre piles that build Ace to Queen; Kings are wild.
|
||||
|
||||
** Bridge
|
||||
- ~cg-bridge~ -- Contract Bridge. A full auction (bids, pass, double,
|
||||
redouble), play with the dummy exposed, and classic rubber scoring with
|
||||
vulnerability. You are South; when you declare you play the dummy too.
|
||||
The bidding AI is a small natural system, sensible but no expert.
|
||||
|
||||
* TODO
|
||||
- [X] make the suit symbols customizable (~cg-symbols~) and obey them
|
||||
- [ ] a Texinfo manual
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue