BBO Discussion Forums: What is wrong with this Dealer-code?? - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

What is wrong with this Dealer-code??

#1 User is offline   jni33 

  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 2009-June-20

Posted 2016-August-27, 12:30

Hi

A good friend of mine has spent some time trying to make some Dealer-scripts. I have a problem when I try to use the Dealer-scrips om BBO in the Practice Bidding room -- I have tried it on Correctcontract.com (using the exact same Dealer-script and getting perfect hands for bidding practice there).
Is anyone here able to tell me why it does not Work on BBO ?

The script starts here:

# ---- Hands for 1X-(1S)-XYZ-(P234S) ----
# ---- by Jesper Dall, August 2016 ----
# EW hands (East is overcaller, West advancer) have been tested to fit real life bidding.
# East may overcall on a good four card suit, so 1S-4S by EW may be on only 8 trumps.
# Indeed, 1S-3S may be on a 4-3 fit, where advancer bids 3S with say KJx xxxxx xxxx x.
# This is very unlikely, of course, but not impossible.
# In short, NS does not know for sure how many spades EW have.
# NS must apply real life common sense under uncertainty.
#
# Vulnerability is not controlled, not possible.
# 3S and 4S bids by advancer are pressure bids, but not terror bids
# It is fair to use the vulnerability of the generated deals,
# although real life vul/non-vul difference for EW hands cannot be implemented
#
# System after 1H (1S) with 3+H: (my suggestion)
# 2NT = 8+, 4+H
# 2S = 10+, 3H
# 3/4MI = Fitbid, 4+H
# 3S = 8+, 0-1S, 4+H
# 2H = 5-9, 3H
# 3H = 5-7, 4+H
# 4H = 0-7, 4+H
# Defensive hands with 4H may be shown as 3H (2S) to discourage 5-level competition
#
# ---- Forcing situations after 1H (1S) ----
# 3S and 4MI forcing vul vs non-vul (red) only
# 2S, 2NT, 2MI and Neg DBL at 3+level forcing on 5-level
# All other bids showing support are non-forcing
# In short, over 4S by advancer pass is forcing only after 3S/4MI vul vs non-vul
# ----
# After 1H-1S-2NT-4S: DBL is action DBL; 4NT RKCB; 5MI cuebid
# After 1H-1S-2S-4S: DBL is action as well, but rarely taken out; 4NT RKCB; 5MI cuebid
# After 1H-1S-2S/2NT-4S, P-P: DBL is penalty; 4NT RKCB; 5MI cuebid
# When Pass is forcing (rare) Pass is encouraging, DBL discouraging/penalty
#

# Text to add as comment on board 1 to clarify to the bidders (change to fit input below):
/*
East overcalls 1S, west raises to 2S (or 3S if necessary).
If North opens 1NT east overcalls 2S and west passes
If North opens with pass, East opens 1S and West raises to 2S.
Vulnerability as indicated.
*/

# INPUT PARAMETERS --- default settings: North opens 1X, West raises 1S to 2S
# The user controls opening bid and how high advancer raises

RAISE = 0 /* Advancer raise: 1 = Pass, 2 = 2S, 3 = 3S, 4 = 4S */
OPENING = 2 /* Opening bid: 0 = 1X, 2 = 1H, 3 = 1D, 4 = 1C, 5 = 1MI */
/* Default settings: RAISE = 1, OPENING = 0 */

HCP_S_MIN = 0 /* Minimum hcp --- South */
HCP_NS_MIN = 23 /* Minimum hcp --- Total */


# --- hcp and losers NS ---
hcp_n = hcp(north) >= 11 and hcp(north) <= 22 and losers(north) >=3
hcp_11_14nt_n = hcp(north) >= 11 and hcp(north) <= 14
hcp_1nt_n = hcp(north) >= 15 and hcp(north) <= 17
hcp_2nt_n = hcp(north) >= 20
hcp_s = hcp(south) >= HCP_S_MIN
hcp_ns = hcp(north) + hcp(south) >= HCP_NS_MIN

# --- hcp and losers EW ---
hcp_e = hcp(east) >= 8 and (losers(east) <= 8 and losers(east) >= 5)
hcp_low_e = hcp(east) < 8 and losers(east) <= 8 and top5(east,spades) >= 3
hcp_P_w = hcp(west) >= 0
hcp_2S_w = hcp(west) <= 8 and (losers(west) <= 10)
hcp_3S_w = hcp(west) <= 8 and (losers(west) <= 10)
hcp_4S_w = hcp(west) >= 0
hcp_w = (RAISE==4 ? hcp_4S_w : (RAISE==3 ? hcp_3S_w : (RAISE==2 ? hcp_2S_w : hcp_P_w)))

hcp_all = (hcp_n and hcp_s) and (hcp_ns) and ((hcp_e or hcp_low_e) and hcp_w)

# --- shape opener ---
shape_bal_n = shape(north, any 4432 + any 4333 + any 5332 - x5xx - 5xxx)
shape_1NT_n = shape_bal_n and hcp_1nt_n
shape_2NT_n = shape_bal_n and hcp_2nt_n
shape_12NT_n = (shape_1NT_n or shape_2NT_n) and (hcp_1nt_n or hcp_2nt_n)
shape_1C_bal_n = shape_bal_n and hcp_11_14nt_n
shape_1S_n = spades(north) >= 5 and spades(north) >= hearts(north)

shape_1H_n = hearts(north) >= 5 and not shape_1S_n
shape_1MA_n = shape_1S_n or shape_1H_n
shape_1D_n = diamonds(north) >= 5 and not (shape_1MA_n or shape_12NT_n)
shape_1X_n = spades(north) >=0 and not shape_2NT_n
shape_1C_n = shape_1X_n and not (shape_1MA_n or shape_1D_n or shape_12NT_n)
shape_1MI_n = shape_1X_n and not (shape_1MA_n or shape_12NT_n)

shape_n = (OPENING == 2 ? shape_1H_n : (OPENING == 3 ? shape_1D_n : (OPENING == 4 ? shape_1C_n : (OPENING == 5 ? shape_1MI_n : shape_1X_n ))))

# --- shape responder (***OK, BUT TO BE DEVELOPED***) ---
shape_nofit_s = hearts(south) <= 2
shape_3H_s = hearts(south) == 3 and hcp(south) >= 10
shape_4H_s = hearts(south) >= 4
shape_s = shape_nofit_s or shape_3H_s or shape_4H_s

shape_ns = shape_n and shape_s

# --- shape overcaller 1X-(1S) ---
# With 4S: 60% of hcp in spades, 3 of 5 top spades, not short in hearts
# ***not perfect for other openings than 1H NB! --- not a serious problem***
# With 5S: Not very distributional, ie 5332 or 54xx or 55xx --- no 4S raise
# With 6S: 6322, max 50% of hcp in spades --- no 4S raise
e_4sp_1 = shape(east, 4xxx - 40xx - 41xx - 42xx - any 4333 - any 6xxx - any 7xxx)
e_4sp_2 = 3*hcp(east,spades) > 2*hcp(east) and hcp(east) >= 8
e_4sp_3 = top5(east,spades) >= 3
e_4sp = e_4sp_1 and e_4sp_2 and e_4sp_3
e_5sp = shape(east, 5xxx) and shape(east, any 5332 + any 54xx + any 5521)
e_6sp_1 = shape(east, 6xxx) and shape(east, any 6322) and losers(east) >= 7
e_6sp_2 = 2*hcp(east, spades) <= hcp(east)
e_6sp = e_6sp_1 and e_6sp_2
shape_1S4S_e = e_4sp or spades(east) >= 5
shape_1S3S_e = e_4sp or e_5sp or e_6sp
shape_1S2S_e = shape_1S3S_e and not shape(east, any 5521)

# --- shape advancer 1H-(1S)-XYZ-(4S) ---
w_4s_unbal = not shape(west, any 4333 + any 4432 + any 5422 + any 4441)
w_4s = shape(west, 4xxx) and w_4s_unbal
w_5s = spades(west) >= 5 and (losers(west) <= 9 or shape(west, any xxx1))
shape_1S4S_w = (w_4s) or (w_5s)

# --- shape advancer 1X-(1S)-XYZ-(3S) ---
# With 3S: 75% of hcp in spades, at least 3 hcp in spades, and a short suit
# With 4S: 75% of hcp in spades if 4333, 40% if 4432, all 4441 and 5422
# With 5S: No short suit and 10+ losers
w_3sp_suitquality = (4*hcp(west,spades) >= 3*hcp(west)) and hcp(west,spades) >= 3
w_3sp_shortness = shape(west, any 0xxx + any 1xxx) and hcp(west) <= 6
w_3sp = shape(west, 3xxx) and w_3sp_suitquality and w_3sp_shortness
w_4sp_4333quality = (4*hcp(west, spades) >= 3*hcp(south))
w_4sp_4333 = shape(west, 4333) and w_4sp_4333quality
w_4sp_4432quality = (5*hcp(west, spades) >= 2*hcp(west))
w_4sp_4432 = shape(west, any 4432) and w_4sp_4432quality
w_4sp_ubalquality = hcp(west,spades) >= 0 /*removed after further testing*/
w_4sp_ubal = shape(west, 4xxx - any 4333 - any 4432) and w_4sp_ubalquality
w_4sp = shape(west, 4xxx) and (w_4sp_4333 or w_4sp_4432 or w_4sp_ubal)
w_5sp = spades(west) >= 5 and losers(west) >= 10 and not shape(west, any xxx1)
shape_1S3S_w = ((w_4sp) or (w_5sp) or (w_3sp)) and not shape_1S4S_w

# --- shape advancer 1X-(1S)-XYZ-(2S) ---
# With 3-4S: and a top 3 spade honour or
# With 3S: shortness but no top3 spade honour
w_2S_honour = spades(west) >= 3 and top3(west,spades)>=1
w_2S_ctr = spades(west) >= 3 and controls(west)>=3
w_2S_3sp_ubal = shape(west, 3xxx) and shape(west, any 0xxx + any 1xxx)
w_2S = w_2S_honour or w_2S_ctr or w_2S_3sp_ubal
shape_1S2S_w = w_2S and not (shape_1S4S_w or shape_1S3S_w)

shape_1SPass_w = not (shape_1S4S_w or shape_1S3S_w or shape_1S2S_w)

max_spades_1S4S_ew = spades(east) + spades(west) <= 11
shape_1SPass_ew = (shape_1SPass_w and shape_1S4S_e)
shape_1S2S_ew = (shape_1S2S_w and shape_1S2S_e)
shape_1S3S_ew = (shape_1S3S_w and shape_1S3S_e)
shape_1S4S_ew = (shape_1S4S_w and shape_1S4S_e) and max_spades_1S4S_ew
shape_ew = (RAISE==4 ? shape_1S4S_ew : (RAISE==3 ? shape_1S3S_ew : (RAISE==2 ? shape_1S2S_ew : shape_1SPass_ew)))

shape_all = shape_ew and shape_ns

condition hcp_all and shape_all
0

#2 User is offline   barmar 

  • PipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 21,398
  • Joined: 2004-August-21
  • Gender:Male

Posted 2016-August-27, 21:37

Remove the comments that are of the form /* stuff */. I'm not sure why, but they're causing the dealer program to return extra output that we can't parse.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users