Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT bids #88

Merged
merged 4 commits into from
Sep 7, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions src/Bids/DONT.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
module Bids.DONT(
b1N -- Re-exported from Meckwell
, b1NoX
, b1NoX2C
, b1No2C
, b1No2C2D
, b1No2D
, b1No2D2H
, b1No2H
, b1No2S
penguinland marked this conversation as resolved.
Show resolved Hide resolved
) where


import Action(Action)
import Bids.Meckwell(singleSuit, twoSuited, b1N)
import EDSL(pointRange, alternatives, makeCall, makeAlertableCall, forEach,
atLeastAsLong)
import qualified Terminology as T



-- What's the right minimum strength to bid DONT? It kinda depends on the
-- vulnerability and where in the hand this strength is located. Let's guess 10
-- is a pretty decent minimum, but I'm open to changing it later.
pointsToCompete :: Action
pointsToCompete = pointRange 10 40


b1NoX :: Action
b1NoX = do
pointsToCompete
-- If you're single-suited with spades, when would you bid 2S and when X?
-- Avoid the choice for now.
penguinland marked this conversation as resolved.
Show resolved Hide resolved
alternatives $ map singleSuit [T.Clubs, T.Diamonds, T.Hearts]
makeAlertableCall T.Double "single-suited hand"


b1NoX2C :: Action
b1NoX2C = makeAlertableCall (T.Bid 2 T.Clubs) "pass or correct"


b1No2C :: Action
b1No2C = do
pointsToCompete
alternatives $ map (twoSuited T.Clubs) [T.Diamonds, T.Hearts, T.Spades]
makeAlertableCall (T.Bid 2 T.Clubs) "clubs and another suit"


b1No2C2D :: Action
b1No2C2D = do
-- Never mind our strength: we'd prefer partner's other suit.
forEach [T.Diamonds, T.Hearts, T.Spades] (`atLeastAsLong` T.Clubs)
makeAlertableCall (T.Bid 2 T.Diamonds) "pass or correct"


b1No2D :: Action
b1No2D = do
pointsToCompete
alternatives $ map (twoSuited T.Diamonds) T.majorSuits
makeAlertableCall (T.Bid 2 T.Diamonds) "diamonds and a major"


b1No2D2H :: Action
b1No2D2H = do
forEach T.majorSuits (`atLeastAsLong` T.Diamonds)
makeAlertableCall (T.Bid 2 T.Hearts) "pass or correct"


b1No2H :: Action
b1No2H = do
pointsToCompete
twoSuited T.Hearts T.Spades
makeAlertableCall (T.Bid 2 T.Hearts) "both majors"


b1No2S :: Action
b1No2S = do
pointsToCompete
singleSuit T.Spades
makeCall $ T.Bid 2 T.Spades
Loading