Examples for the Dealer Program

These examples are going to be used to generate practice hands for partnerships. We'll start with some simple examples and work our way up. In each case, we'll assume that we want east to be the opening bidder.

Opening 2C Bid Hands

# Generate hands for practicing bidding after 2C

east_ok = hcp(east)>=21  

condition
	east_ok 
action
	print(east, west)

Opening 1NT Bid Hands

# Generate hands for practicing bidding after 1NT
# We'll give west some limits just to keep it interesting.

east_ok = shape(east, any 4333 + any 4432 + any 5332 - 5xxx - x5xx)
	&& hcp(east) >= 16 && hcp (east) <=17

west_ok1 = hcp(west)>= 7 && hcp(west)<=9
west_ok2 = hcp(west)>=13 or shape(west, any 0xxx)

condition
	east_ok and (west_ok1 or west_ok2)
action
	print(east, west)

Opening 1S Bid Hands

east_ok = hcp(east) >=13 and hcp(east) <= 20 && spades(east) >= 5

condition
	east_ok
action
	print(east, west)

Opening 1 of a minor

#This generates 1 of a minor openings. #Note that we have to check if east has a 1NT opening or a #5 card major east_ok = hcp(east)>= 13 and hcp(east)<= 20 east_major = spades(east) >= 5 or hearts(east) >= 5 east_NT = hcp(east)>= 16 and hcp(east)<=18 and shape(east, any 4333 + any 4432) condition east_ok and !(east_major) and !(east_NT) action print(east,west)

Back to the Dealer Main Page