BBO Discussion Forums: Assigning honours to suits - BBO Discussion Forums

Jump to content

Page 1 of 1

Assigning honours to suits

#1 User is offline   pescetom 

  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 7,948
  • Joined: 2014-February-18
  • Gender:Male
  • Location:Italy

Posted 2021-May-14, 08:56

I am comfortable with preassigning the entire hand of N, or setting an hcp range for the entire hand of N, but is there some way of preassigning just the hearts suit of N, or setting an hcp range for just the hearts suit? Or evaluating if N has say ♥K? This would make simulations more precise (for example ensuring that a weak two opening by N has at least one high honour in the suit).
0

#2 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 2021-May-14, 09:38

View Postpescetom, on 2021-May-14, 08:56, said:

I am comfortable with preassigning the entire hand of N, or setting an hcp range for the entire hand of N, but is there some way of preassigning just the hearts suit of N, or setting an hcp range for just the hearts suit? Or even assigning specific honours? This would make simulations more precise (for example ensuring that a weak two opening by has at least one high honour in the suit).
You can try
condition hcp (north) > 4 and 10 > hcp (north) and hearts (north) == 6 and 
top3 (north, hearts) > 0  

1

#3 User is offline   mycroft 

  • Secretary Bird
  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 7,457
  • Joined: 2003-July-12
  • Gender:Male
  • Location:Calgary, D18; Chapala, D16

Posted 2021-May-14, 09:52

from the Manual:

Quote

A player can be pre-dealt any number of cards, e.g. for a play problem it is possible to give dummy and declarer their specific hands and the opening-leader the card he just led. The program then generates hands by dividing the remaining 25 cards over the two other players.

An alternate form of predeal specification is (suit)(player)==1 (for example: "spades(north)==1" and variants thereof for different suits, compass positions, numbers); this will ensure that (player) gets exactly the number of spades specified, (in this case, one), but that spade can be any card (except for the ones predealt to other players). predeal (player),(card) will just force the program to give these cards to this player, without any restrictions for the remaining cards. For example, predeal north,S2 will give north the 2 of spades. However, all other spade cards can still be dealt to north, so north will not necessarily have a singleton spade 2.


for your range in suit question:

condition hcp(hearts, north) > 3


or for straight cards in suit:

condition hascard(north, HA) or hascard(north, HK) or hascard (north, HQ)


Note the requirements for condition:

Quote

Note that if more than one condition is specified, this is not diagnosed as an error, but the last condition will override the other(s); to have several conditions apply at once, you have to join them into a single expression, i.e. a single condition statement, joining them with "&&" or equivalently "and".

Deals not meeting the condition are considered to be "generated" but not "produced", and no action is undertaken for them.


It is very possible to set up a condition such that you have to generate millions of hands to get 10 results. Try to limit in non-condition ways first.
When I go to sea, don't fear for me, Fear For The Storm -- Birdie and the Swansong (tSCoSI)
1

#4 User is offline   pescetom 

  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 7,948
  • Joined: 2014-February-18
  • Gender:Male
  • Location:Italy

Posted 2021-May-14, 12:25

Thanks to both, will experiment as soon as the dealergib1 site connects :)
0

Page 1 of 1


Fast Reply

  

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