Dealer Scripts, summarised
#1
Posted 2009-April-16, 09:18
In order to use the scripts, just copy/paste the relevant scripts when using new BBO's bidding/teaching table DEAL SOURCE ADVANCED Option.
Hrothgar's 4 ace point count
Hrothgar's Kaplan + Rubens Point Count
John Nelson.
#2
Posted 2010-October-30, 11:44
2-level opening bids:
( hcp(north)>=22 or
(( hcp(north)>=6 and hcp(north)<=10) and
( (spades(north)==6 and hcp(north,spades)>=5) or
(hearts(north)==6 and hcp(north,hearts)>=5) or
(diamonds(north)==6 and hcp(north,diamonds)>=5 ))))
1m opening bid + simple overcall
(( hcp(north)>=11 and clubs(north)>=5 and spades(north)<=4 and hearts(north)<=4 ) or
( hcp(north)>=11 and diamonds(north)>=5 and spades(north)<=4 and hearts(north)<=4 ) or
( hcp(north)>=12 and hcp(north)<=14 and spades(north)<=4 and hearts(north)<=4 ) or
( hcp(north)>=18 and hcp(north)<=19 and spades(north)<=4 and hearts(north)<=4 )
) and
(( hcp(east)>=9 and spades(east)>=5 ) or
( hcp(east)>=9 and hearts(east)>=5 ) or
( hcp(east)>=11 and clubs(east)>=6) or
( hcp(east)>=11 and diamonds(east)>=6))
#4
Posted 2011-April-26, 15:17
Feleran, on 2011-April-26, 10:51, said:
Or how can I ask Dealer to deal one player a hand with (say) excactly 2 aces?
This deals a specific hand
predeal north S5432, H432, D432, C432
These deal specific numbers of honour cards
aces(south)==0 and kings(south)==1 and queens(south)<=2 and jacks(south)>=3 and tens(south)!=4
!= means not equal to.
"hascard" also deals specific cards but is rather long winded although can be useful for some specific cards. Here is the long winded way of specifying two aces.
(hascard(south,AS) and hascard(south,AH) and not hascard(south,AD) and not hascard(south,AC)) or (hascard(south,AS) and not hascard(south,AH) and hascard(south,AD) and not hascard(south,AC)) or (hascard(south,AS) and not hascard(south,AH) and not hascard(south,AD) and hascard(south,AC)) or (not hascard(south,AS) and hascard(south,AH) and hascard(south,AD) and not hascard(south,AC)) or (not hascard(south,AS) and hascard(south,AH) and not hascard(south,AD) and hascard(south,AC)) or (not hascard(south,AS) and not hascard(south,AH) and hascard(south,AD) and hascard(south,AC))
I believe that the USA currently hold only the World Championship For People Who Still Bid Like Your Auntie Gladys - dburn
dunno how to play 4 card majors - JLOGIC
True but I know Standard American and what better reason could I have for playing Precision? - Hideous Hog
Bidding is an estimation of probabilities SJ Simon
#5
Posted 2011-May-09, 21:19
bigN = shape(north, any 6xxx + any 7xxx + any 8xxx + any 9xxx + any 00xx + any 01xx + any 11xx + any 02xx + any 12xx + any 03xx )
bigS = shape(south, any 6xxx + any 7xxx + any 8xxx + any 9xxx + any 00xx + any 01xx + any 11xx + any 02xx + any 12xx + any 03xx )
bigE = shape(east, any 6xxx + any 7xxx + any 8xxx + any 9xxx + any 00xx + any 01xx + any 11xx + any 02xx + any 12xx + any 03xx )
bigW = shape(west, any 6xxx + any 7xxx + any 8xxx + any 9xxx + any 00xx + any 01xx + any 11xx + any 02xx + any 12xx + any 03xx )
solidN = (hascard(north, AS) and hascard(north, KS) and hascard(north, QS) and hascard(north, JS) and hascard(north, TS) and
(shape(north, 6xxx) OR shape(north, 7xxx) OR shape(north, 8xxx) OR shape(north, 9xxx)) or
(hascard(north, AH) and hascard(north, KH) and hascard(north, QH) and hascard(north, JH) and hascard(north, TH) and
(shape(north, x6xx) OR shape(north, x7xx) OR shape(north, x8xx) OR shape(north, x9xx)) (hascard(north, AD) and hascard(north, KD) and hascard(north, QD) and hascard(north, JD) and hascard(north, TD) and
(shape(north, xx6x) OR shape(north, xx7x) OR shape(north, xx8x) OR shape(north, xx9x)) or
(hascard(north, AC) and hascard(north, KC) and hascard(north, QC) and hascard(north, JC) and hascard(north, TC) and
(shape(north, xxx6) OR shape(north, xxx7) OR shape(north, xxx8) OR shape(north, xxx9))
solidS = (hascard(south, AS) and hascard(south, KS) and hascard(south, QS) and hascard(south, JS) and hascard(south, TS) and
(shape(south, 6xxx) OR shape(south, 7xxx) OR shape(south, 8xxx) OR shape(south, 9xxx)) or
(hascard(south, AH) and hascard(south, KH) and hascard(south, QH) and hascard(south, JH) and hascard(south, TH) and
(shape(south, x6xx) OR shape(south, x7xx) OR shape(south, x8xx) OR shape(south, x9xx)) (hascard(south, AD) and hascard(south, KD) and hascard(south, QD) and hascard(south, JD) and hascard(south, TD) and
(shape(south, xx6x) OR shape(south, xx7x) OR shape(south, xx8x) OR shape(south, xx9x)) or
(hascard(south, AC) and hascard(south, KC) and hascard(south, QC) and hascard(south, JC) and hascard(south, TC) and
(shape(south, xxx6) OR shape(south, xxx7) OR shape(south, xxx8) OR shape(south, xxx9))
twoN = shape(north, any 55xx + any 56xx + any 57xx + any 58xx + any 66xx + any 67xx)
twoS = shape(south, any 55xx + any 56xx + any 57xx + any 58xx + any 66xx + any 67xx)
highNS = hcp(south)+hcp(north)>20
majorsNS = shape(north, 5xxx + x5xx) or shape(south, 5xxx + x5xx)
spadeEW = spades(west)+spades(east)>9
diamondEW = diamonds(west)+diamonds(east)>9
heartEW = hearts(west)+hearts(east)>9
clubEW = clubs(west)+clubs(east)>9
competition = clubEW or heartEW or diamondEW or spadeEW
bigE and bigW and bigN and bigS
#7
Posted 2011-December-22, 23:08
popovitsj, on 2011-December-22, 19:08, said:
I need South to hold AKQxxxx in Clubs and 9-11 HCP, and North to hold 14+ HCP.
What would be the script to accomplish this?
clubs(south)==7 and
hascard(south,AC) and hascard(south,KC) and hascard(south,QC) and
hcp(north)>=14
You also need to set the dealer to south.
If your gambling no trump has other conditions then you might need some other constraint on the hcp or other honours.
You can also accomplish the constraint on the club suit with
hcp(south,clubs)>=9
You may also be interested in longer minor suits.
With a solid minor suit and no side honours (ace or king):
(
(clubs(south)>=7 and hcp(south,clubs)>=9 and
hcp(south,diamonds)<=3 and not hascard(south,KD)) or
(diamonds(south)>=7 and hcp(south,diamonds)>=9 and
hcp(south,clubs)<=3 and not hascard(south,KC))
) and
hcp(south,spades)<=3 and not hascard(south,KS) and
hcp(south,hearts)<=3 and not hascard(south,KH) and
hcp(north)>=14
I believe that the USA currently hold only the World Championship For People Who Still Bid Like Your Auntie Gladys - dburn
dunno how to play 4 card majors - JLOGIC
True but I know Standard American and what better reason could I have for playing Precision? - Hideous Hog
Bidding is an estimation of probabilities SJ Simon
#8
Posted 2011-December-22, 23:10
So
(
(clubs(south)>=7 and hcp(south,clubs)>=9) or
(diamonds(south)>=7 and hcp(south,diamonds)>=9)
) and
hcp(south)<=11 and
hcp(north)>=14
is simpler and should work.
I believe that the USA currently hold only the World Championship For People Who Still Bid Like Your Auntie Gladys - dburn
dunno how to play 4 card majors - JLOGIC
True but I know Standard American and what better reason could I have for playing Precision? - Hideous Hog
Bidding is an estimation of probabilities SJ Simon
#9
Posted 2012-February-20, 11:16
If you use the dealer within BBO Web, you may quickly get frustrated by the fact that you get the same error message whether your script had bad syntax, or the hand(s) that the script will generate are too improbable to be generated within the time allotted.
There are several features that are documented
here: http://henku.home.xs...input_file.html , and
here: http://svn.df7cb.de/...nual/dealer.txt
that at least as of the time of this post several features are not supported - for example, dealer, vulnerable, ... (vulnerable would be a really good thing to support IMO). You can also ignore the actions for use in the BBO hand editor, though they are supported in the standalone dealer program. There is also an "extended" shape syntax that is documented that relies on a perl preprocesser, shapes with curly braces and + signs. These can't be used in the generator.
If you want to try "programming" the dealer, it may be far more convenient to do so, first, in a standalone version of the dealer:
http://www.bridgebas...aler/dealer.php
That version will identify the first line containing a syntax error, if there is one, and tell you what is wrong with the line.
#10
Posted 2012-June-26, 16:44
# They (West) open a weak only Multi 2D - 5-9pts, 6 card suit, 3+pts in suit, no outside 4 card major or 5 card suit.
# East has a maximum of 8pts
# Max EW total pts =9+8=17pts. Min EW pts =5+0=5pts.
condition (shape(west, 6x4x + 6xx4 -64xx +63xx +6x3x +6xx3) and hcp(west)>=5 and hcp(west)<=9 and hcp(west, spades)>=3 and hcp(east)<=8) or
(shape(west, x64x + x6x4 -46xx +36xx +x63x +x6x3) and hcp(west)>=5 and hcp(west)<=9 and hcp(west, hearts)>=3 and hcp(east)<=8)
#11
Posted 2012-November-06, 16:21
FM75, on 2012-February-20, 11:16, said:
+1
I was also looking if I could set or read the dealer/vuln/board number for the hand that I'm generating. When I read the documentation I understood that they won't work correctly for BBO dealer. Problem is that for standard alone dealer those settings are simple affecting output information for deal printing.
Even if setting deal number would be supported that wouldn't be exactly what I would like to do. For me the most usefull feature would be to have dealer(compass)/vuln(compass) syntax support for the conditional syntaxt. That would allow deal script to modify the condition based on dealer and vulnrability information. I suppose that shouldn't be hard to add to the BBO dealer but you are very busy with other more important stuff.
#12
Posted 2012-November-06, 16:47
I offered to provide Fred with the relatively minimal changes, but he did not have much interest at the time.
That said, I believe that you can set the dealer and vulnerability on each hand that you generate, after you have stored them on BBO. Sure it is an extra step, but you are only creating deals one at a time on BBO anyway and you can name or number them as you like as well.
#13
Posted 2013-May-19, 14:55
FM75, on 2012-November-06, 16:47, said:
Could you please post a link to the Mac executable & source?
ty, tOM
#17
Posted 2014-May-02, 16:05
#18
Posted 2014-May-02, 16:12
patiw, on 2014-May-02, 16:05, said:
((hearts(north)>=5&&hcp(north)>=8&&hcp(north)<=13)|| (diamonds(north)>=5&&hcp(north)>=8&&hcp(north)<=13)|| (spades(north)>=5&&hcp(north)>=8&&hcp(north)<=13))
Now i must exclude 5422 and 5332 shape
add the following
and not shape(north, any 5422, any 5332)
#19
Posted 2014-May-02, 16:14
######### 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 and c13(north)>=900)
or
(hcp(north)==14 and cccc(north)>=1900 and c13(north)>=900)
or
(hcp(north)==13 and cccc(north)>=2000 and c13(north)>=900)
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
(
spade(north) >= 4 or
clubs(north) >= 5
)
two_spades =
not opening_strength and
hcp(north) <= 12 and
c13(north) >= 325
and
(
(
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)
###########
two_diamonds
#20
Posted 2014-May-02, 17:19
generate 10000 produce 1000 vulnerable NS dealer north north2h=((hearts(north)>=5 && hcp(north)>=8 && hcp(north)<=13 && not shape(north, any 5422, any 5332) ) north2d=(diamonds(north)>=5 && hcp(north)>=8 && hcp(north)<=13 && not shape(north, any 5422, any 5332) ) north2s=(spades(north)>=5 && hcp(north)>=8 && hcp(north)<=13) && not shape(north, any 5422, any 5332) ) condition north2h || north2d || north2s action printpbn
should working ?