I'm not up on the details of particular varieties of bridge - I prefer poker - but, from a UI-perspective, the less math the interface requires you to do, the better.
On Sun, Mar 27, 2016 at 12:51 PM, Brian Schott <[email protected]> wrote: > Henry and others, > > As you may be aware I have been adapting Henry's bridge scoring script to > my own small group's needs. We play straight contract bridge, not Chicago, > which means that non-rubber ending games yield 300 bonus points and the > rubber-ending game produces 500 points. > > I have attempted to produce a JHS version which uses html controls that > means no handwriting because buttons produce all needed inputs. > Unfortunately, until today* I have not been successful in making the button > entry system work on my iPad and so that aspect of the application has > remained untested during actual play. > > But I have had 2 occasions to test the application while others have been > the scorekeeper but with no html entry, only the traditional text entry, > much like Henry's script(s) require. I have found that I have made entry > errors twice when the declarer makes overtricks. [As background (others may > need this), a 3NT bid which makes 5NT requires +2 entry (5-3 = 2), and I > have twice incorrectly done that subtraction mentally.] One of my bridge > buddies suggested that the entry for "made" hands be the tricks made (5, in > my example) and that the subtraction be done in code. For contracts not > made, the negative inputs work fine, as is, apparently. My bridge buddy > said that at duplicate events this strategy is used when the duplicate > center has digital entry devices. So I am considering altering my script > accordingly; what do you think? > > By the way, the current script is at the following jwiki link. > > http://code.jsoftware.com/wiki/User:Brian_Schott/code/BridgeScoring > > > > > *The javascript for radio button selection that worked for other browsers > would not work on my iPad. But I found a workaround that seems to work, now > and have updated my jwiki entry. > > On Sat, Mar 27, 2010 at 1:24 PM, Henry Rich <[email protected]> wrote: > > > Yes, odd handles the odd tricks and after I posted it I realized that > > for readability I should have split it into above-the-line and > > below-the-line as > > > > 'below above' =. (2^dbl) * (10 0 * suit=4) + (level,y) * suit { 2 3 # 20 > 30 > > > > and then {.odd and {:odd could be replaced. > > > > Hey, wait, I didn't include the partscore bonus! I'll append a fixed > > version. > > > > To handle rubber bridge or Chicago, you have other considerations: > > 0. most games still allow honors; > > 1. You need to be able to specify the partscore bonus: 0 except for the > > last hand, then 300 (or whatever local custom calls for); > > 2. You might need to consider that some old-fashioned players don't > > accept the scoring changes of 1987; for them doubled nonvulnerable > > undertricks go 1-3-5-7... , and 50 for the insult is not changed to 100 > > when there is a redouble. > > 3. As you say, you would need to pass in any existing partscore. Maybe > > you would add on to x, making it > > 'level suit vul dbl leg psbonus' =. 6 {. x > > > > > > Second version below > > > > Henry Rich > > > > NB. score bridge (duplicate and Chicago) > > NB. x is contract: level suit vul dbl [leg partscorebonus] > > NB. suit is 0=C, 4=NT > > NB. dbl is 0, 1, or 2 > > NB. y is result, neg=down, nonneg=made > > NB. result is score for contracting side > > NB. Does not support honors > > bridgescore =: 4 : 0"1 0 > > 'level suit vul dbl leg psb' =. x , (#x) }. 0 0 0 0 0 50 > > if. y < 0 do. > > if. dbl do. > > dbl * 100 + (y * 300) - 100 * ((y * -.vul) >. _2) > > else. > > y * vul { 50 100 > > end. > > else. > > 'b a' =. (2^dbl) * (10 0 * suit=4) + (level,y) * suit { 2 3 # 20 30 > > pts =. (dbl * 50) + b + (100 <: leg+b) { psb , vul { 300 500 > > pts =. pts + (<vul,level) { _8 {."1 ] 500 1000 ,: 750 1500 > > pts =. pts + dbl { a , (>:vul) * y * 100 200 > > end. > > ) > > > > > > > > Brian Schott wrote: > > > Henry, > > > > > > Yes, I like your crisp code very much. I want to alter it to > > > accommodate existing part scores and splitting the result into above- > > > and below-the-line portions. > > > > > > It seems that the temporary noun `odd` produces the below-the-line > > > portion as its first element, right? And that could be partitioned > > > from the final result to produce the two parts? > > > > > > On the other hand if the existing part scores were appended to the y > > > argument, making it a vector argument, wouldn't that be a way to > > > produce a multipart `result` that would resemble the resulting score, > > > at least for winning contracts? > > > > > > Thank you so much for sharing this code. > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > (B=) <-----my sig > Brian Schott > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- Devon McCormick, CFA Quantitative Consultant ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
