BBO Discussion Forums: Question about dealer advanced grammar of tricks() expression. - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Question about dealer advanced grammar of tricks() expression.

#1 User is offline   zjuwyz 

  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 2018-May-12

Posted 2019-August-09, 23:58

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

Quote

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?
0

#2 User is offline   Gerardo 

  • PipPipPipPipPipPip
  • Group: Admin
  • Posts: 2,492
  • Joined: 2003-February-12
  • Gender:Male
  • Location:Dartmouth, NS, Canada

Posted 2019-August-11, 09:12

strain is a suit name or notrump(s)

But this function is currently not supported by us in our current setup.

#3 User is offline   zjuwyz 

  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 2018-May-12

Posted 2019-August-12, 04:30

View PostGerardo, on 2019-August-11, 09:12, said:

strain is a suit name or notrump(s)

But this function is currently not supported by us in our current setup.


I see, thanks. Hope this feature to be supported in the future.
0

#4 User is offline   barmar 

  • PipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 21,570
  • Joined: 2004-August-21
  • Gender:Male

Posted 2019-August-12, 08:25

View Postzjuwyz, on 2019-August-12, 04:30, said:

I see, thanks. Hope this feature to be supported in the future.

This is the first time anyone has even mentioned it, as far as I know.

#5 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 2019-August-13, 13:51

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.
0

#6 User is offline   Gerardo 

  • PipPipPipPipPipPip
  • Group: Admin
  • Posts: 2,492
  • Joined: 2003-February-12
  • Gender:Male
  • Location:Dartmouth, NS, Canada

Posted 2019-August-13, 18:19

tricks() works there.

Had to add "action" on its own line before frequency.

That generates just the frequency though, no hans are shown.

#7 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 2019-August-14, 05:47

View PostGerardo, on 2019-August-13, 18:19, said:

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.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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