Jump to content

Question about dealer advanced grammar of tricks() expression.


zjuwyz

Recommended Posts

Hi! I'm learning dealer grammar recently, and find "tricks()" expression very useful, especially when I want to generate some hands that NS surely have a game to play.

In the document, it is described as

tricks(compass, strain)

Runs GIB's double-dummy engine (BRIDGE under Linux, BRIDGE.EXE under Windows/NT or /98), which must be present on the path or in the same directory as the Dealer executable (together with, on Windows, SH.EXE and CYGWIN.DLL from Cygnus' free Cygwin package; this latter is not necessary in Paul Baxter's version), to compute the number of tricks that, at double-dummy par, will be taken by the given declarer in the given strain (suit or notrumps).

 

However, I couldn't find the word "strain" anywhere else in the document. I also looked through Examples.zip and found nothing, sadly.

 

I tried "tricks(north, notrump)>=7", "tricks(north, notrumps) >= 7", "tricks(north, spade) >= 7", "tricks(north, spades) >= 7", "tricks(north, 1s) >= 7", "tricks(north, x1s) >= 7" etc. None of these works. Error message returns immediately, not as those almost impossible ones like "hcp(north) == 40" which uses up the trial limitation. Most likely there is a syntax error, or the environment (as described in the document) on the server is incorrect.

 

Can anyone help?

Link to comment
Share on other sites

The best forum for this kind of topic is

Full disclosure and Dealer

 

This version of Dealer no longer seems to work

Dealer + GIB -- version that supports tricks function

 

Using that version, you could run a script like...

 

/** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
tricks.ds. 19 Oct 2017. NG
Trick expectation at double-dummy.
Script for Dealer by Hans van Staveren & Henk Uijterwaal
http://dealergib1.bridgebase.com/tools/dealer/dealer.php
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** **/
predeal east SQT32, HQ932, D864, CA9

# 1N opener
ntHCP = 16
wHCP = hcp (west)
w1N =
(shape (west, any 4333 + any 4432) and 
ntHCP - 2 < wHCP and wHCP < ntHCP + 2) or
(shape (west, any 5332 + any 5422 + any 6322
- 5422 - 4522 - 6xxx - x6xx) and
ntHCP - 2 < wHCP and wHCP < ntHCP + 1)

produce 100
condition w1N
frequency "NT tricks, West" (tricks (west, notrump), 8, 9),

 

This avoided the need to install your own version of Dealer and Gib.

Link to comment
Share on other sites

tricks() works there. Had to add "action" on its own line before frequency. That generates just the frequency though, no hans are shown.

 

Thank you Gerardo, It worked before but I didn't include the "action" verb in my example above, which should be ...

 

 

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
tricks.ds. 14 Aug 2019. NG
Trick expectation at double-dummy.
Script for Dealer by Hans van Staveren & Henk Uijterwaal
[url="http://dealergib1.bridgebase.com/tools/dealer/dealer.php"]http://dealergib1.br...aler/dealer.php[/url]
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** **/
predeal east SQT32, HQ932, D864, CA9

# 1N opener
ntHCP = 16
wHCP = hcp (west)
w1N =
(shape (west, any 4333 + any 4432) and 
ntHCP - 2 < wHCP and wHCP < ntHCP + 2) or
(shape (west, any 5332 + any 5422 + any 6322
- 5422 - 4522 - 6xxx - x6xx) and
ntHCP - 2 < wHCP and wHCP < ntHCP + 1)

produce 100
condition w1N
action frequency "NT tricks, West" (tricks (west, notrump), 8, 9),

 

The output of this script is

 

Frequency NT tricks, West:
Low          38 
     8          38 
     9          20
High            4
Generated 1296 hands
Produced 	100 hands
Initial random seed 1565783392 
Time needed    4.395 sec

 

You can also use "printall" or whatever to display the relevant hands.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...