Skip to content

Commit

Permalink
PR feedback: require that cue bids be semibalanced without a stack in…
Browse files Browse the repository at this point in the history
… the opps' suit
  • Loading branch information
penguinland committed Jan 26, 2025
1 parent b26c6f2 commit 8eede20
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Bids/Lebensohl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ import Control.Monad(when)
import Action(Action, withholdBid)
import qualified Bids.OneNotrump as NT
import EDSL(minSuitLength, makeCall, makeAlertableCall, pointRange, forEach,
forbid, forbidAll, balancedHand, hasStopper, alternatives,
soundHolding, longerThan, atLeastAsLong, suitLength)
forbid, forbidAll, balancedHand, semibalancedHand, hasStopper,
alternatives, soundHolding, longerThan, atLeastAsLong, suitLength,
maxSuitLength)
import Output((.+))
import qualified Terminology as T

Expand Down Expand Up @@ -286,10 +287,16 @@ b1NoBM2N3C3N = bid3N_ [T.Hearts, T.Spades] True
cueBid_ :: T.Suit -> Bool -> Action
cueBid_ oppsSuit shouldHaveStopper = do
NT.gameForcing
semibalancedHand
-- TODO: if the opponents overcall a natural 2D, do you need exactly 4-4 in
-- the majors? What if you're 4-3? What if you're 5-4?
forEach (filter (/= oppsSuit) T.majorSuits) (`suitLength` 4)
when shouldHaveStopper (hasStopper oppsSuit)
-- Simultaneously, make sure you don't want to just double the opponents
-- because you've got their suit. This isn't so important when they made a
-- 2-suited bid (they'd just run to the second suit), but this part of the
-- code doesn't know about that. Assume it's just a natural bid.
maxSuitLength oppsSuit 4
makeAlertableCall (T.Bid 3 oppsSuit)
("Stayman with" ++
(if shouldHaveStopper then "" else "out") ++
Expand Down
8 changes: 8 additions & 0 deletions src/EDSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module EDSL (
, makePass
, pointRange
, balancedHand
, semibalancedHand
, flatHand
, suitLength
, minSuitLength
Expand Down Expand Up @@ -81,6 +82,13 @@ balancedHand =
constrain "balanced" ["shape(", ", any 4333 + any 5332 + any 4432)"]


semibalancedHand :: Action
semibalancedHand =
alternatives [ balancedHand
, constrain "semibalanced" ["shape(", ", any 5422 + any 6322"]
]


flatHand :: Action
flatHand = constrain "flat" ["shape(", ", any 4333)"]

Expand Down

0 comments on commit 8eede20

Please sign in to comment.