'If' dealer script conditional
#1
Posted 2015-March-10, 22:44
I want west to bid based on Easts overcall in hearts, then dealer script to generate splinter type hands for west. When I've got that right I can have East overcalling in other suits with splinters for those.
Why? My partner and I are trialling Ruben Transfers and Lebensohl, and I want to generate different hands to test sequences and combinations.
Most of my code is working so far but I'm stuck at testing East's Heart holding. I've looked around the site but haven't found similar code as yet.
My condition statement starts:
(hearts(east) >= 5 ? shape(west, + x4x1 + ..... but it (this part of my script) doesn't seem to 'know' what easts holding is.
Do I have to make easts holding into a variable, that I can then check against? And how would I do that, or is there an alternative approach?
thanks from unskilled scripture
Ash
#2
Posted 2015-March-11, 02:08
kiwinacol, on 2015-March-10, 22:44, said:
I want west to bid based on Easts overcall in hearts, then dealer script to generate splinter type hands for west. When I've got that right I can have East overcalling in other suits with splinters for those.
Why? My partner and I are trialling Ruben Transfers and Lebensohl, and I want to generate different hands to test sequences and combinations.
Most of my code is working so far but I'm stuck at testing East's Heart holding. I've looked around the site but haven't found similar code as yet.
My condition statement starts:
(hearts(east) >= 5 ? shape(west, + x4x1 + ..... but it (this part of my script) doesn't seem to 'know' what easts holding is.
Do I have to make easts holding into a variable, that I can then check against? And how would I do that, or is there an alternative approach?
thanks from unskilled scripture
Ash
Try
hearts(east)>=5 and shape(west, x4x1 + x41x + 14xx)
You might also need
spades(east)<hearts(east)
otherwise you get 65xx hands and maybe similar constraints for diamonds and clubs. You could also allow voids into your splinters:
hearts(east)>=5 and
spades(east)<hearts(east) and
diamonds(east)<=hearts(east) and
clubs(east)<=hearts(east) and
hearts(west)>=4 and
(spades(west)<2 or diamonds(west)<2 or clubs(west)<2)
should give pretty much any heart hand and splinter.
You can also constrain the hcp in east and west - hcp(east)>=11 or similar.
Feel free to message me if you need more help
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
#3
Posted 2015-March-11, 18:01
I’ve incorporated one of your tips into the north hand - thanks.
My hope was to get one West ‘IF’ working, then nest the other suits in their ‘else’
An issue I’ve notice with my “OR” ’s for East is that the choices don’t get equal selection. The first, clubs is generated much more than the last OR in hearts. Is there any way of evening up the priority?
Also I suspect when code for West is run, it ‘robs’ cards from other hands to fit that hands code requirements, even when that results in north no longer has >=5 spades and fewer HCP’s?
my,
(hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx))
doesn’t generate errors, but also doesn’t work when east has hearts as the overcall >=5 suit.
Is there an expression to temporarily deactivate a line or lines?
==================
North: 1S (>=5 card), (other suits <=5 cards) opening bid, 11 - 14 HCP
East:
simple Major overcall 7-10 HCP (with 5+HCP in M)
or simple minor overcall 10-12 HCP, 5+ card suits (with 6+HCP in 5 m)
West: balance of cards and HCP ( for overcall suit, hand has splinter raises, at the moment 3 card support OK, later voids )
the, : shape(west, xxx2) xxx2 is just junk to give me an indication that the first ‘then’ has been rejected
South: 4-7 HCP, S support, any xxx (enough for single raise)
North/South: <= 20 HCP
======start of code
( hcp(north)>=12 and hcp(north)<=14 and spades(north)>=5 and hearts(north)<=spades(north) and diamonds(north)<=hearts(north) and clubs(north)<=hearts(north))
and
(( hcp(east)>=9 and hcp(east)<=12 and hcp(east,clubs)>=6 and clubs(east)>=5)
or
( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=5 and diamonds(east)>=6)
or
( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=6 and diamonds(east)>=5)
or
( hcp(east)>=7 and hcp(east)<=11 and hcp(east,hearts)>=5 and hearts(east)>=6 )
or
( hcp(east)>=7 and hcp(east)<=12 and hcp(east,hearts)>=6 and hearts(east)>=5 ))
and
(hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx))
and
(hcp(south)>=4 and hcp(south)<=6 and hcp(north)+hcp(south)<=20 and spades(south)<=3 )
======end of code
#4
Posted 2015-March-11, 20:23
# # (1S) 2H (2S) splinter # produce 10 N1S = spades (north) > 4 and spades (north) >= hearts (north) and spades (north) >= diamonds (north) and spades (north) >= clubs (north) and hcp (north) > 9 and hcp (north) < 15 E2H = hearts (east) > 4 and hcp (east, hearts) > 4 and hearts (east) >= diamonds (east) and hearts (east) >= clubs (east) and hcp (east) > 6 and hcp (east) < 11 S2S = spades (south) > 2 and hcp (south) > 3 and hcp (south) < 8 WSPL = shape (west, any xxx1 + any xxx0) WHSPL = WSPL and hearts (west) > 2 NS20 = hcp (north) + hcp (south) < 20 condition N1S and E2H and S2S and WHSPL and NS20
#5
Posted 2015-March-11, 23:32
kiwinacol, on 2015-March-11, 18:01, said:
I’ve incorporated one of your tips into the north hand - thanks.
My hope was to get one West ‘IF’ working, then nest the other suits in their ‘else’
An issue I’ve notice with my “OR” ’s for East is that the choices don’t get equal selection. The first, clubs is generated much more than the last OR in hearts. Is there any way of evening up the priority?
Also I suspect when code for West is run, it ‘robs’ cards from other hands to fit that hands code requirements, even when that results in north no longer has >=5 spades and fewer HCP’s?
my,
(hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx))
doesn’t generate errors, but also doesn’t work when east has hearts as the overcall >=5 suit.
Is there an expression to temporarily deactivate a line or lines?
==================
North: 1S (>=5 card), (other suits <=5 cards) opening bid, 11 - 14 HCP
East:
simple Major overcall 7-10 HCP (with 5+HCP in M)
or simple minor overcall 10-12 HCP, 5+ card suits (with 6+HCP in 5 m)
West: balance of cards and HCP ( for overcall suit, hand has splinter raises, at the moment 3 card support OK, later voids )
the, : shape(west, xxx2) xxx2 is just junk to give me an indication that the first ‘then’ has been rejected
South: 4-7 HCP, S support, any xxx (enough for single raise)
North/South: <= 20 HCP
======start of code
( hcp(north)>=12 and hcp(north)<=14 and spades(north)>=5 and hearts(north)<=spades(north) and diamonds(north)<=hearts(north) and clubs(north)<=hearts(north))
and
(( hcp(east)>=9 and hcp(east)<=12 and hcp(east,clubs)>=6 and clubs(east)>=5)
or
( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=5 and diamonds(east)>=6)
or
( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=6 and diamonds(east)>=5)
or
( hcp(east)>=7 and hcp(east)<=11 and hcp(east,hearts)>=5 and hearts(east)>=6 )
or
( hcp(east)>=7 and hcp(east)<=12 and hcp(east,hearts)>=6 and hearts(east)>=5 ))
and
(hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx))
and
(hcp(south)>=4 and hcp(south)<=6 and hcp(north)+hcp(south)<=20 and spades(south)<=3 )
======end of code
I think this does roughly what you want:
# Minimum spade opening for north ( hcp(north)>=12 and hcp(north)<=14 and spades(north)>=5 and hearts(north)<=spades(north) and diamonds(north)<=hearts(north) and clubs(north)<=hearts(north)) and (( # Club overcall hcp(east)>=9 and hcp(east)<=12 and hcp(east,clubs)>=6 and clubs(east)>=5) or # Diamond overcall ( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=5 and diamonds(east)>=6) or ( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=6 and diamonds(east)>=5) or # Heart overcall ( hcp(east)>=7 and hcp(east)<=11 and hcp(east,hearts)>=5 and hearts(east)>=6 ) or ( hcp(east)>=7 and hcp(east)<=12 and hcp(east,hearts)>=6 and hearts(east)>=5 )) and #If heart overcall does west have splinter (hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx)) and # If diamond overcall does west have splinter (diamonds(east) >= 5 ? shape(west, + xx41 + x14x + xx41+ xx31 + x13x + xx31 ) : shape(west, xxxx)) and # If club overcall does west have splinter (clubs(east) >= 5 ? shape(west, + xx14 + x1x4 + 1xx4+ xx13 + x1x3 + 1xx3 ) : shape(west, xxxx)) and # Responder is weak (hcp(south)>=4 and hcp(south)<=6 and hcp(north)+hcp(south)<=20 and spades(south)<=3 )
1. I haven't seen dealer misdeal hands. It always has generated hands consistent with all of the constraints specified for me.
2. I think your club frequency is because your constraint of north specifies
diamonds(north)<=hearts(north) and clubs(north)<=hearts(north)rather than
diamonds(north)<=spades(north) and clubs(north)<=spades(north)which pretty much guarantees north will have long hearts.
3. Inserting a # comments out a line so it will not be executed.
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
#6
Posted 2015-March-12, 02:14
#7
Posted 2015-March-12, 03:54
Mbodell, on 2015-March-12, 02:14, said:
#9
Posted 2015-March-12, 03:55
Cascade, on 2015-March-11, 23:32, said:
# Minimum spade opening for north ( hcp(north)>=12 and hcp(north)<=14 and spades(north)>=5 and hearts(north)<=spades(north) and diamonds(north)<=hearts(north) and clubs(north)<=hearts(north)) and (( # Club overcall hcp(east)>=9 and hcp(east)<=12 and hcp(east,clubs)>=6 and clubs(east)>=5) or # Diamond overcall ( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=5 and diamonds(east)>=6) or ( hcp(east)>=9 and hcp(east)<=12 and hcp(east,diamonds)>=6 and diamonds(east)>=5) or # Heart overcall ( hcp(east)>=7 and hcp(east)<=11 and hcp(east,hearts)>=5 and hearts(east)>=6 ) or ( hcp(east)>=7 and hcp(east)<=12 and hcp(east,hearts)>=6 and hearts(east)>=5 )) and #If heart overcall does west have splinter (hearts(east) >= 5 ? shape(west, + x4x1 + x41x + x4x1+ x3x1 + x31x + x3x1 ) : shape(west, xxxx)) and # If diamond overcall does west have splinter (diamonds(east) >= 5 ? shape(west, + xx41 + x14x + xx41+ xx31 + x13x + xx31 ) : shape(west, xxxx)) and # If club overcall does west have splinter (clubs(east) >= 5 ? shape(west, + xx14 + x1x4 + 1xx4+ xx13 + x1x3 + 1xx3 ) : shape(west, xxxx)) and # Responder is weak (hcp(south)>=4 and hcp(south)<=6 and hcp(north)+hcp(south)<=20 and spades(south)<=3 )
1. I haven't seen dealer misdeal hands. It always has generated hands consistent with all of the constraints specified for me.
2. I think your club frequency is because your constraint of north specifies
diamonds(north)<=hearts(north) and clubs(north)<=hearts(north)rather than
diamonds(north)<=spades(north) and clubs(north)<=spades(north)which pretty much guarantees north will have long hearts.
3. Inserting a # comments out a line so it will not be executed.
#11
Posted 2015-March-12, 14:29
nige1, on 2015-March-11, 20:23, said:
# # (1S) 2H (2S) splinter # produce 10 N1S = spades (north) > 4 and spades (north) >= hearts (north) and spades (north) >= diamonds (north) and spades (north) >= clubs (north) and hcp (north) > 9 and hcp (north) < 15 E2H = hearts (east) > 4 and hcp (east, hearts) > 4 and hearts (east) >= diamonds (east) and hearts (east) >= clubs (east) and hcp (east) > 6 and hcp (east) < 11 S2S = spades (south) > 2 and hcp (south) > 3 and hcp (south) < 8 WSPL = shape (west, any xxx1 + any xxx0) WHSPL = WSPL and hearts (west) > 2 NS20 = hcp (north) + hcp (south) < 20 condition N1S and E2H and S2S and WHSPL and NS20