pescetom Posted October 25, 2020 Report Share Posted October 25, 2020 Can anyone please spot why the following draft script gives 'Can't open temporary file' unless I comment out the 'action average' line?What causes that error message in general?Thanks. Dealer script: # # 1NT vs 1M opening comparison # nt1517= hcp(north)>=15 and hcp(north)<=17 invite= hcp(south)>=8 and hcp(south)<=9 thingame= hcp(south)>=10 and hcp(south)<=10 safegame= hcp(south)>=11 and hcp(south)<=12 resp5332= shape(south, any 5332) s5 = spades(north)==5 and shape(north, any 5332) produce 20 action average "Avg. tricks if N plays in spades" (tricks(north,spades)), average "Avg. tricks if N plays in notrump" (tricks(north,notrump)) condition nt1517 and s5 and invite and resp5332 Quote Link to comment Share on other sites More sharing options...
hrothgar Posted October 25, 2020 Report Share Posted October 25, 2020 move the condition above the action average statements Dealer ignores whitespace and right now the silly thing believes that condition is part of the second average statement Quote Link to comment Share on other sites More sharing options...
nullve Posted October 25, 2020 Report Share Posted October 25, 2020 Make sure you use http://dealergib1.bridgebase.com/tools/dealer/dealer.php, mentioned by uday here, and not https://www.bridgebase.com/tools/dealer/dealer.php. . Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 25, 2020 Author Report Share Posted October 25, 2020 move the condition above the action average statements Dealer ignores whitespace and right now the silly thing believes that condition is part of the second average statementThanks.nullve, that might be an issue with your 'Close Decision' script too (I tried moving the condition and got 10.29 for E in clubs). Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 25, 2020 Author Report Share Posted October 25, 2020 Make sure you use http://dealergib1.bridgebase.com/tools/dealer/dealer.php, mentioned by uday here, and not https://www.bridgebase.com/tools/dealer/dealer.php. .Thanks, that was the 'temp file' problem.Maybe BBO could link the new page into the client (or at least a sticky topic in this forum) so it can be found more easily. Quote Link to comment Share on other sites More sharing options...
nullve Posted October 25, 2020 Report Share Posted October 25, 2020 nullve, that might be an issue with your 'Close Decision' script too (I tried moving the condition and got 10.29 for E in clubs).Moving the condition doesn't seem to make much difference when I do it, but maybe it should. :unsure: Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 26, 2020 Author Report Share Posted October 26, 2020 If I may trouble you with some further teething problems.. I can't get 'printes' to work, even pasting in the example from the Input File:action printes "Number of hearts: ", hearts(north), \ngives 'syntax error'. I needed this to debug an attempt at using 'score', which also gives syntax error in the line below, perhaps just because I have not found a valid value for the 'vulnerability' parameter (I tried using keywords none or EW, plus the expression vulnerable(none)):action frequency "Freq 2s scores:" (score(none,"x2s",tricks(north,spades)),-300,170)gives 'syntax error'. Quote Link to comment Share on other sites More sharing options...
nullve Posted October 26, 2020 Report Share Posted October 26, 2020 I can't get 'printes' to work, even pasting in the example from the Input File:action printes "Number of hearts: ", hearts(north), \ngives 'syntax error'. action printes ("Number of hearts: ", hearts(north),\n) seems to work. Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 26, 2020 Author Report Share Posted October 26, 2020 action printes ("Number of hearts: ", hearts(north),\n) seems to work.Thanks, it does. And yet: action printes ("Score 2s 8 tricks: ", score(none,"x2S",8), \n) still gives 'syntax error'. Maybe there is an example of 'score' somewhere. Quote Link to comment Share on other sites More sharing options...
nullve Posted October 26, 2020 Report Share Posted October 26, 2020 I needed this to debug an attempt at using 'score', which also gives syntax error in the line below, perhaps just because I have not found a valid value for the 'vulnerability' parameter (I tried using keywords none or EW, plus the expression vulnerable(none)):action frequency "Freq 2s scores:" (score(none,"x2s",tricks(north,spades)),-300,170)gives 'syntax error'. vulnerable ({none|NS|EW|all})Sets the vulnerability for the hand to 1 of the 4 possibilities, with none the default if the command is not in the input file.This command is primarily intended for cases where action-list includes the printpbn action and the hands will be fed into another program for further analysis. These programs often require that the dealer and vulnerability are known. This command allows the user to set the vulnerability, the next command allows him to set the dealer. [...] score(vulnerability, contract, tricks)Returns the positive or negative score that declarer will make if the given contract, at the given vulnerability condition, is played and the given number of tricks are made. The syntax for "contract" is of the form "x3N" for 3 no-trumps, "x7C" for 7 clubs, etc; the leading "x" is needed. There is currently no way to specify that the contract is doubled, nor that it is re-doubled. The result will be positive if the contract makes, negative if it goes down.I don't know how to make the 'score' operator work, either, but my guess is that the 'vulnerability' argument does not have everything to do with the 'vulnerable' operator. (For example, if 'vulnerable' is set to 'EW', then the contract is vulnerable iff played by EW.) Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 26, 2020 Author Report Share Posted October 26, 2020 I don't know how to make the 'score' operator work, either, but my guess is that the 'vulnerability' argument does not have everything to do with the 'vulnerable' operator. (For example, if 'vulnerable' is set to 'EW', then the contract is vulnerable iff played by EW.)I tried setting 'vulnerability' to NS at the top of the script and that worked, but did not help when parsing 'score'.As first argument to score I tried none, "none", NS, 0, blank etc.I also tried omitting the first argument altogether.I think it knows it is parsing the function score, if I change the name I get 'unknown variable'. I see that this old thread asked the same question and got no answer.Surely such a precious function will have been used by someone (or at least be known to be broken)? Quote Link to comment Share on other sites More sharing options...
nullve Posted October 26, 2020 Report Share Posted October 26, 2020 Script: produce 1 action printes (score(vul,x7C,13),\n) Run: 2140 Generated 1 hands Produced 1 hands Initial random seed 1603746614 Time needed 0.000 sec So the first argument is 'vul' if the contract is vulnerable. Haven't figured out what it is when the contract is not vulnerable. Quote Link to comment Share on other sites More sharing options...
pescetom Posted October 26, 2020 Author Report Share Posted October 26, 2020 So the first argument is 'vul' if the contract is vulnerable. Haven't figured out what it is when the contract is not vulnerable. Found that too, 'nv'. Thanks again.These guys sure know how to be consistent and document well B-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts