BBO Discussion Forums: 'If' dealer script - BBO Discussion Forums

Jump to content

Page 1 of 1

'If' dealer script conditional

#1 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-10, 22:44

Greetings all,

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
0

#2 User is offline   Cascade 

  • PipPipPipPipPipPipPipPip
  • Group: Yellows
  • Posts: 6,765
  • Joined: 2003-July-22
  • Gender:Male
  • Location:New Zealand
  • Interests:Juggling, Unicycling

Posted 2015-March-11, 02:08

View Postkiwinacol, on 2015-March-10, 22:44, said:

Greetings all,

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
Wayne Burrows

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 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-11, 18:01

Hello Wayne, and thanks for your help.

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
0

#4 User is offline   nige1 

  • 5-level belongs to me
  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 9,128
  • Joined: 2004-August-30
  • Gender:Male
  • Location:Glasgow Scotland
  • Interests:Poems Computers

Posted 2015-March-11, 20:23

You might try something like
#
# (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

0

#5 User is offline   Cascade 

  • PipPipPipPipPipPipPipPip
  • Group: Yellows
  • Posts: 6,765
  • Joined: 2003-July-22
  • Gender:Male
  • Location:New Zealand
  • Interests:Juggling, Unicycling

Posted 2015-March-11, 23:32

View Postkiwinacol, on 2015-March-11, 18:01, said:

Hello Wayne, and thanks for your help.

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.
Wayne Burrows

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 User is offline   Mbodell 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,871
  • Joined: 2007-April-22
  • Location:Santa Clara, CA

Posted 2015-March-12, 02:14

As scripts get closer to good, it is likely worth running off 10-20 hands and posting them to get people agreeing that they look good. At least when things get complicated. Obviously you can do this on your own a lot while debugging (I tend to find things in my own scripts primarily this way before starting a long sim).
0

#7 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 03:54

View PostMbodell, on 2015-March-12, 02:14, said:

As scripts get closer to good, it is likely worth running off 10-20 hands and posting them to get people agreeing that they look good. At least when things get complicated. Obviously you can do this on your own a lot while debugging (I tend to find things in my own scripts primarily this way before starting a long sim).

0

#8 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 03:54

thanks
0

#9 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 03:55

View PostCascade, on 2015-March-11, 23:32, said:

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.

0

#10 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 03:56

Wayne,
great support,
thanks,

Ash
0

#11 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 14:29

View Postnige1, on 2015-March-11, 20:23, said:

You might try something like
#
# (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


0

#12 User is offline   kiwinacol 

  • PipPipPip
  • Group: Full Members
  • Posts: 79
  • Joined: 2014-July-02
  • Gender:Male
  • Location:New Zealand

Posted 2015-March-12, 14:30

Nige1,

thanks for your support and help
0

Page 1 of 1


Fast Reply

  

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