Posted 2010-September-21, 18:41
I THINK this is reasonable accurate (this version doesn't have slam point adjustments for 10 card suits)
(Guests just left my first annual Beer, Bison, and Botulism bash... I am somewhat buzzed, stuffed to the gills, and have neither the time nor the inclination to check the code)
######### Definition - Opening Points
# 11 is the index for c13
# This function allows the user to define valuations for cacluating HCP
# Most hand evaluation is performed used a modified version of the
# 4 Aces Point Count.(Ace = 3, King = 2, ...)
# All values are multiplied by 100 to avoid fractions
#altcount 11 300 200 100 50 20
############## STRONG OPENINGS
one_club =
(
hcp(north)>=17
#or
#c13(north) >=1000
or
(hcp(north)>=15 and cccc(north)>=1600)
or
(hcp(north)==14 and cccc(north)>=1900)
or
(hcp(north)==13 and cccc(north)>=2000)
or
(
hcp(north)>=15 and shape(north, any 4333 + any 4432 + any 5332 + any 5422)
#and
#c13(north) >= 900
)
)
#####
#Opening strength defines the minimum strength for a limited opening bid
#####
opening_strength =
(
(
cccc(north) - 25 * shape(north, any 4441 + any 5440) >= 1050
or hcp(north) >= 11
)
# and
# c13(north) >= 600
)
and not
one_club
#MOSCITO Opening structure
#################### SINGLE SUITED PREEMPTS
#################### MAJORS
four_diamonds =
(
(
spades(north) >= 8 and
hascard(north, AS) + hascard(north, KS) == 2
)
or
(
spades(north) == 7 and
hascard(north, AS) + hascard(north, KS) + hascard(north,QS) == 3
)
)
and
hascard(north,AC) + hascard(north,KC) +
hascard(north,AD) + hascard(north,KD) +
hascard(north,AH) + hascard(north,KH) <=1
four_spades =
hcp(north) <= 9
and
(
(
spades(north) >= 7 and
hascard(north, AS) + hascard(north, KS) +
hascard(north,QS) + hascard(north, JS) >= 3
)
or
spades(north) >= 8
)
and not four_diamonds
three_spades =
spades(north) >= 6
and
(
hascard(north, AS) + hascard(north, KS) +
hascard(north, QS) + hascard(north, JS) >= 2
)
and
(
hearts(north) <=1 or
diamonds(north) <=1 or
clubs(north) <= 1
)
and
hcp(north) <= 9
and not four_diamonds
and not four_spades
four_clubs =
(
(
hearts(north) >= 8 and
hascard(north,AH) + hascard(north,KH) == 2
)
or
(
hearts(north) == 7 and
hascard(north,AH) + hascard(north,KH) + hascard(north,QH) == 3
)
)
and
hascard(north,AC) + hascard(north,KC) +
hascard(north,AD) + hascard(north,KD) +
hascard(north,AS) + hascard(north,KS) <=1
four_hearts =
hcp(north) <= 9
and
(
(
hearts(north) >= 7 and
hascard(north, AH) + hascard(north, KH) +
hascard(north,QH) + hascard(north, JH) >= 3
)
or
spades(north) >= 8
)
and not four_clubs
three_hearts =
hearts(north) >= 6
and
(
hascard(north, AH) + hascard(north, KH) +
hascard(north, QH) + hascard(north, JH) >= 2
)
and
(
spades(north) <=1 or
diamonds(north) <=1 or
clubs(north) <= 1
)
and
hcp(north) <= 9
and not four_clubs
and not four_hearts
############## MINORS
three_nt =
hcp(north) <= 9
and
(
(
clubs(north) >= 8
and
hascard(north,AS) + hascard(north,KS) +
hascard(north,AH) + hascard(north,KH) +
hascard(north,AD) + hascard(north,KD) <= 1
)
or
(
diamonds(north) >= 8
and
hascard(north,AS) + hascard(north,KS) +
hascard(north,AH) + hascard(north,KH) +
hascard(north,AC) + hascard(north,KC) <= 1
)
)
three_clubs =
clubs(north) >= 6
and
hascard(north, AC) + hascard(north, KC) + hascard(north, QC) == 2 and
hascard(north, AD) + hascard(north, KD) +
hascard(north, AH) + hascard(north, KH) +
hascard(north, AS) + hascard(north, KS) == 0 and
hcp(north) <=9
and not three_nt
three_diamonds =
diamonds(north) >= 6
and
hascard(north, AD) + hascard(north, KD) + hascard(north, QD) == 2 and
hascard(north, AC) + hascard(north, KC) +
hascard(north, AH) + hascard(north, KH) +
hascard(north, AS) + hascard(north, KS) == 0 and
hcp(north) <=9
and not three_nt
two_nt =
(clubs(north) >=6 and
hascard(north, AC) + hascard(north, KC) + hascard(north, QC) +
hascard(north, JC) == 2
and
hascard(north, AD) + hascard(north, KD) +
hascard(north, AH) + hascard(north, KH) +
hascard(north, AS) + hascard(north, KS) == 0
and
hascard(north, QD) + hascard(north, QH) + hascard(north, QS) <= 1
and
not three_clubs)
or
(
diamonds(north) >=6 and
hascard(north, AD) + hascard(north, KD) + hascard(north, QD) +
hascard(north, JD) == 2
and
hascard(north, AC) + hascard(north, KC) +
hascard(north, AH) + hascard(north, KH) +
hascard(north, AS) + hascard(north, KS) == 0 and
hascard(north, QC) + hascard(north, QH) + hascard(north, QS) <= 1 and
not three_diamonds
)
and not three_nt
preempts =
four_spades or
four_clubs or
three_spades or
four_hearts or
four_clubs or
three_hearts or
three_diamonds or
three_clubs or
three_nt or
two_nt
###############################
## Weak Opening Bids
###############################
two_diamonds =
not opening_strength and
hcp(north) <= 12
#and c13(north) >= 325
and
shape(north, any 4432, any 54xx, any 55xx, any 65xx) and
clubs(north) <= 3 and
diamonds(north) >=4
two_hearts =
not opening_strength and
hcp(north) <= 12 and
#c13(north) >= 325 and
shape(north, any 4432, any 54xx, any 55xx, any 65xx) and
hearts(north) >= 4 and
(
spades(north) >= 4 or
clubs(north) >= 5
)
two_spades =
not opening_strength and
hcp(north) <= 12 and
#c13(north) >= 325
(
(
shape(north, any 6322, any 6331, any 7222) and
spades(north) >=6
)
or
(
spades(north) >=4 and clubs(north) >=5
and hascard(north, AS) + hascard(north, KS) + hascard(north, QS) >= 1
)
)
############## LIMITED OPENINGS
##### Pre-Definitions
bad_spades = hascard(north, AS) + hascard(north, KS) + hascard(north,QS) == 0
bad_hearts = hascard(north, AH) + hascard(north, KH) + hascard(north,QH) == 0
balanced = shape(north, any 4432, any 5332, any 4333)
########
two_clubs =
opening_strength
and not preempts
and
(
(
clubs(north) >= 6 and
spades(north) < 4 and
hearts(north) < 3
)
or
(
clubs(north) >= 6 and
spades(north) == 4 and
bad_spades
)
or
(
clubs(north) >= 6 and
hearts(north) == 4 and
bad_hearts
)
)
one_notrump =
opening_strength and
(
(
balanced and not
shape(north, 5xxx, x5xx, 44xx, 4x4x, 4xx4, x44x, x4x4)
)
or
(
hearts(north) == 4 and
balanced and
(hcp(north) == 11 or hcp(north) == 12)
)
or
(
spades(north) == 4 and
balanced and
hearts(north) <= 3 and
(hcp(north) == 13 or hcp(north) == 14)
)
)
one_spade =
opening_strength
and not preempts
and not one_notrump
and
diamonds(north) >= 4 and
not one_notrump and
hearts(north) <4 and
spades(north) <4
or
(
diamonds(north) >=6 and
(
(spades(north) == 4 and bad_spades) or
(hearts(north) == 4 and bad_hearts)
)
)
one_heart =
opening_strength and
not two_clubs and
not one_notrump and
not one_spade and
(
(
spades(north) == 4 and
spades(north) > hearts(north)
)
or
(
spades(north) >= 5 and
spades(north) >= hearts(north)
)
)
one_diamond =
opening_strength and
not two_clubs and
not one_notrump and
not one_spade and
not one_heart
and
hearts(north) >= 4
and not
(balanced and hcp(north) <= 11)
advance =
hcp(south) >= 5 and
hcp(south) <= 10 and
spades(south) >=4 and
spades(south) <= 5 and
hearts(south) >= 4 and
hearts(south) <= 5
and diamonds(south) >= 2
#and
#(
#clubs(south) >= 3 or
#diamonds(south) >= 3
#)
***** =
(
spades(north) <= 2 and
hearts(north) <= 2 and
diamonds(north) >= 5
)
##########
condition
one_heart and spades(south) == 6
action
average hascard(south, 2S) and hascard(south, 3S)
#average hascard(south, 3C) and hascard(south, 2C),
#average hascard(south, 2C) and hascard(south, 2D),
#average hascard(south, 2C) and hascard(south, 2S)
#average "advance" advance
#
#printall
#
#average "*****" *****
Alderaan delenda est