home *** CD-ROM | disk | FTP | other *** search
/ Sunny 1,000 Collection / SUNNY1000.iso / Files / W31 / Casinak / BRIDGE30.ZIP / RULES.TXT < prev    next >
Text File  |  1995-04-08  |  18KB  |  384 lines

  1.                           MODIFYING RULES FILES                           
  2.                           
  3. If you want to try modifying rule files to change the bidding logic and/or
  4. play drills, please read this file carefully.  If you do not plan to 
  5. change the data files, it is not necessary to learn this information.
  6.                        
  7. A rule file contains lines of text that the computer scans one line at a
  8. time from the top of the file. It is critical that if you use an editor
  9. to modify a rule file, that each line must remain exactly the same length.
  10. Use an editor that will display non-printable characters to check the 
  11. location of the carriage return and line feed characters at the end of each
  12. line. They should all be in the same horizontal position. Also make sure 
  13. that each line is the length shown below, for example, the first line in
  14. Current.obr is 18 characters long, followed by a carriage return/line
  15. feed combination. If you modify rules by using the utilities provided with
  16. the program, the program will maintain the correct sizes for you, but it
  17. is not as convenient to scroll through the records as it is with a text
  18. editor.
  19. The computer tries to match the hand with a pattern shown in the file.  If
  20. any part of the pattern is blank, a match is automatic for that part, so
  21. if a hand pattern in a rule file is totally blank, the pattern will match 
  22. and the computer will stop searching and return the information from that 
  23. line. Whenever the computer finds a match, it stops searching and returns.
  24. That is why general rules come last, because if a general or blank pattern
  25. rule came near the top of a rule file, the computer would never scan past
  26. that line.
  27. The information returned by the computer depends on the point value of the
  28. hand. For responding bids, it could be any one of 5 different bids, one
  29. for each point range.
  30.                        
  31.                         
  32.                           BIDDING RULE DATA FILES
  33.   
  34.                            OPENING BID RULES
  35.                                                     
  36. CURRENT.OBR - The rules for opening bids.  This rule file is structured
  37.               differently than other bidding rules files, as no partner
  38.               bid is being tested. The program only searches for opening
  39.               bids that fall within the point ranges defined by the user.
  40.               
  41.               
  42. Example of the first line in Current.obr:
  43.  
  44. 3 2 0 1 0 0 2 1 5 3 1 1 -14 4 2 2 1    example line
  45. | | | | | | | | | | | | | | | | | |        
  46. 1 2 3 4 5 6 7 8 9 10| 12| 14| 16| 18     references
  47.                     11  13  15  17  
  48.                       
  49. Reference:
  50. 1 = two digits for point value of a 7 card plus suit if not zero
  51. 2 = two digits for point value of a 6 card suit              "       
  52. 3 = two digits for point value of a 5 card suit              "
  53. 4 = two digits for point value of a void suit if not zero
  54. 5 = two digits for point value of a singleton suit if not zero
  55. 6 = two digits for point value of a doubleton suit if not zero
  56. 7 = two digits for point value if responder has 6 cards to support opener 
  57. 8 = two digits for point value if responder has 5 cards to support opener
  58. 9-11 = two digits each for responder's short suits with support for opener's
  59.     suit - replaces length points in references 1 - 6 above.
  60.     9= void, 10 = singleton, 11 = doubleton.
  61. 12 = two digits for point value of having all aces
  62. 13 = two digits for point value for no aces
  63. 14 = two digits for suit length required to open a major suit
  64. 15 = two digits for suit length required to open a minor suit
  65. 16 = two digits for negative value of an unprotected king (expressed as a positive)
  66. 17 = two digits for negative value of an unprotected queen  ""
  67. 18 = two digits for negative value of an unprotected jack   ""                                                                                                                                                                                                                                                                                       
  68.  
  69.  
  70. Example of the second line of Current.obr
  71.  
  72. 7 1012161822241321132122252225262825271 0    Second line
  73. | | | | | | | | | | | | | | | | | | | | |
  74. 1 2 3 4 5 6 7 8 9 10| 12| 14| 16| 18| 20|    References:
  75.                     11  13  15  17  19  21
  76. References:
  77. 1 = two digits for lowest value of a pre-emptive opener
  78. 2 = two digits for highest value of a pre=emptive opener
  79. 3 = two digits for the maximum value of a pass opener
  80. 4 = two digits for the minimum value of a "One NoTrump" opener
  81. 5 = two digits for the maximum value of a "One NoTrump" opener
  82. 6 = two digits for the minimum value of a "Two NoTrump" opener
  83. 7 = two digits for the maximum value of a "Two NoTrump" opener
  84. 8 = two digits for the minimum value of a "One Club" opener
  85. 9 = two digits for the maximum value of a "One Club" opener
  86. 10 = two digits for the minimum value of a "One of a Suit" opener
  87. 11 = two digits for the maximum value of a "One of a Suit" opener
  88. 12 = two digits for the minimum value of a "Two Clubs" opener
  89. 13 = two digits for the maximum value of a "Two Clubs" opener
  90. 14 = two digits for the minumum value of a "Two of a Suit" opener
  91. 15 = two digits for the maximum value of a "Two of a Suit" opener
  92. 16 = two digits for the minimum value of a "Four of a Suit" opener
  93. 17 = two digits for the maximum value of a "Four of a Suit" opener
  94. 18 = two digits for the minimum value of a "Three NoTrump" opener
  95. 19 = two digits for the maximum value of a "Three NoTrump" opener
  96. 20 = two digits for the value of opening in the 3rd or 4th position
  97.      (this is added to the distribution points allowing a lower hand to open)
  98. 21 = two digits for the value of being vulnerable
  99.      (this is subtracted from the distribution points forcing a slightly
  100.       higher point requirement to open)
  101.  
  102.                                             
  103. Example rule line (lines 3 and onward):
  104.  
  105. 1N2+   3+   3+   3+   a rule line
  106. | | |  | |  | |  | |
  107. 1 2 3  4 5  6 7  8 9  references
  108.  
  109. References:
  110. 1 = two digits for the bid to consider. The program will only search for 
  111.     bids that fall into the point ranges above.  It will search for pre-
  112.     emptive bids first, then pass bids, then no trump bids if the point range
  113.     fits, then for a one club bid if the point range fits,
  114.     then for one of a suit or other. 
  115.     (example: if the hand had 17 points in hi cards, the program will search
  116.     all 1N bids to see if the hand pattern fits (balanced hand), if yes, it
  117.     will return a 1NT bid, otherwise it will then search 1 of a suit bids
  118.     for a pattern fit.)
  119. 2 = two digits for the length value of spades in the hand, the second digit
  120.     is a qualifyer @= exact, + = or more, - = or less. A '<' in the second
  121.     digit means that the suit has less cards than the other suit that has
  122.     a length value. If these two digits are blank, then a length fit is
  123.     automatic for this suit since length does not influence the bid in
  124.     this case.
  125. 3 = three digits for the card value of the top three cards in spades. This
  126.     card pattern is only used by the program if there are values in these
  127.     digits.  A blank pattern indicates that card values are not required to
  128.     consider the bid.  Pattern: A= Ace, K= King, Q=Queen, J=Jack, T=Ten,
  129.     X=less than ten, k=king or better, q=queen or better, j=jack or better,
  130.     t=ten or better, x= any card.        
  131. 4 = two digits for length value of hearts. Same requirements as spades.
  132. 5 = three digits for card pattern for hearts. Same as spades.
  133. 6 = two digits for length value of diamonds. Same as spades.
  134. 7 = three digits for card pattern for diamonds. Same as spades.
  135. 8 = two digits for length value of clubs. Same as spades.
  136. 9 = three digits for card pattern for clubs. Same as spades.
  137.  
  138.  
  139.  
  140.                      REBIDDING/RESPONDING BID RULES
  141.                    
  142. Responding bid rules are split into two classes of rule files.  One for
  143. Opener's responses to Responder's bids ( Rebid files), and for
  144. Responder's bids back to the Opener (Response files). 
  145. The structures of the rule files for each class are exactly the same so both
  146. will be dealt with here. The only differences between the two classes of
  147. files is the bid level point ranges. (this will be explained below)
  148. The point ranges are found in the file BRIDGE.CFG, but I wouldn't recommend
  149. that you play with these values until you are very familiar with the entire
  150. system.  The default ranges are shown below:
  151.  
  152. BRIDGE.CFG:
  153. Res061011121316171920   (Responder's point ranges)
  154. Reb131617181922232526   (Rebidder's point ranges)
  155. Ret192324252629303233   (Combined Responder and Opener's point ranges)
  156. Ntr000708091014151819   (Responding to 1 notrump openers point ranges)
  157. Slm0032333637           (Combined points for slam bidding)
  158. |  | | | | | | | | |
  159. 1  2 3 4 5 6 7 8 9 10    Reference line
  160. References: 
  161. 1 = An identifyer used by the program
  162. 2 = Bid Level 1 minumum value - two digits
  163. 3 = Bid Level 1 maximum value -  "   "
  164. 4 = Bid Level 2 minimum value -  "   "
  165. 5 = Bid Level 2 maximum value -  "   "
  166. 6 = Bid Level 3 minimum value -  "   "                         
  167. 7 = Bid Level 3 maximum value -  "   "
  168. 8 = Bid Level 4 minumum value -  "   "
  169. 9 = Bid Level 4 maximum value -  "   "
  170. 10 = Bid Level 5 minimum value - "   "
  171.  
  172.  
  173.  
  174.  
  175. Rebid Rule Files - REBID.2, REBID.3
  176. Response Rule Files - RESPONSE.1, RESPONSE.2, RESPONSE.3
  177.  
  178. Once an hand has opened or overcalled, the CURRENT.OBR file is closed and
  179. the above files are used to find bids for the Rebidder. Rebid.2 is for the
  180. second bid of the Opener (first after opening), and Rebid.3 is for all
  181. subsequent rebids. Rebid.2 uses the bid level point ranges indentified
  182. by the Reb line in Bridge.cfg, but the Rebid.3 file uses the bid level
  183. point ranges shown on the Ret line in that file. This assumes that most if
  184. not all point information should be conveyed by the third bid of either
  185. partner. In any case, that is all this program will consider without 
  186. modifications. The corresponding response bid files are Response.1,
  187. Response.2 and Response.3.
  188.  
  189.  
  190. Example of a rebid or response rule:
  191.  
  192. 1S       5@Aqj          2H3H4H4N4N2H  example rule
  193. | ||| |  | |  | |  | |  | | | | | |
  194. 1 2|4 5  6 7  8 9  10|  12| 14| 16|   references
  195.    3                 11   13  15  17
  196.    
  197. References:
  198. 1 = two digits for the Partner's bid to which this hand must respond
  199. 2 = one digit for Partner's first bid suit
  200. 3 = one digit for This hand's first bid suit, or trump suit after two bids
  201. 4 = two digits Length value for spades. All these length and pattern
  202.     values are the same as the length and patterns in current.obr and 
  203.     were explained earlier in this document.
  204. 5 = three digits for card pattern for spades
  205. 6 = two digits for length value of hearts
  206. 7 = three digits for card pattern for hearts 
  207. 8 = two digits for length value of diamonds
  208. 9 = three digits for card pattern for diamonds
  209. 10 = two digits for length value of clubs
  210. 11 = three digits for card pattern for clubs
  211. 12 = two digits, bid to make if point range is in bid level 1 range.
  212. 13 = two digits, bid for bid level 2
  213. 14 = two digits, bid for bid level 3
  214. 15 = two digits, bid for bid level 4
  215. 16 = two digits, bid for bid level 5
  216. 17 = two digits, bid if forced and normal bid level bid would have been a pass
  217. Total length= 18.
  218. In the example above, if the partner bid one spade and this hand had exactly 
  219. 5 hearts headed by the Ace, then queen or better, then jack or better, the
  220. pattern will match and the program will make the bid for the hand's point 
  221. range bid level. If the points are in bid level one, the first bid (reference
  222. 12)- 2H, is made, level 2 means the program makes the 2nd bid shown by 
  223. (reference 13)- 3H, etc.
  224.      
  225. The above files have a numeric extension to the file name, and they are the
  226. current files being used by the program to bid.  The same information is
  227. also stored in files for each bidding system.  Files with the extension
  228. *.RBn are rebid files and files ending with *.RSn are response files.  The
  229. file name in front of the dot is the name of the system.  When you select
  230. to make  a set of bidding rules current, the program will overwrite all
  231. the rebid.* and response.* files with the corresponding *.RBn and *.RSn
  232. files. These rules will then become the current rules, and will remain in
  233. effect until the next time you select to make a new set current.
  234.  
  235.  
  236.  
  237.                                 PLAYING RULES
  238.  
  239.  
  240. Playing rules are text files with data for driving the opening lead, finesse
  241. situations, promotion of high cards in a suit opportunities, establishment
  242. of long suit opportunities, and ruffing short suit possibilities.
  243. These files are used by the various drill programs under the Utilities Menu.
  244. The files could use a lot more work.  There is no limit as to the size of
  245. the files, so they could become quite large and extensive if a user wanted
  246. more sophisticated drills.
  247.  
  248. There is no utility under program control to modify these files, so any
  249. modifications must be done with a plain text editor.  The same warnings
  250. apply to these files too - don't alter the horizontal spacing between data,
  251. as every character in a line is used by the program. In the various
  252. card patterns shown in the following files the cards are identified as
  253. follows: A=Ace,K=King,k=King or better,Q=Queen, q=Queen or better, J=Jack,
  254. j=Jack or better, T=Ten, t=Ten or better, X= less than Ten, x= any card.
  255.  
  256. Except for opening lead rules, the program searches all playing rule files 
  257. four times for each hand. Once for each of the four suits.
  258.  
  259. OPEN.PR - The rules for finding opening leads.
  260.  
  261. DC1@   1@   3+A  2+   HS    - example line
  262. ||| |  | |  | |  | |  ||
  263. 123 4  5 6  7 8  9 10 ||    - references
  264.                      11|
  265.                        12
  266. References:
  267. 1 - Trump suit (SHDC=the trump suit, T=any trump suit, N=no trump suit)
  268. 2 - Partner's first bid suit (if any)
  269. 3 - Spade suit length and qualifyer (if any)
  270. 4 - Spade suit card pattern (if any)
  271. 5 - Heart suit length and pattern
  272. 6 - Heart suit pattern
  273. 7 - Diamond suit length and qualifyer
  274. 8 - Diamond suit pattern
  275. 9 - Club suit length and qualifyer
  276. 10- Club suit pattern
  277. 11- Lead card (H=highest, L = lowest, 4=4th highest, 2=2nd highest)
  278.               (any other letter represents the card directly T=ten, J=jack)
  279. 12- Lead suit
  280.  
  281. The same processing rules apply as with other rule files.  The most specific
  282. rules should be first with more general rules later.
  283.  
  284.  
  285. FINESSE.PR - The rules for selecting finesse opportunities.
  286.  
  287. These files show the patterns for Declarer and Dummy hands only. The file
  288. is used once for every suit, so there are no suit qualifiers within the
  289. file.
  290.  
  291. 5@AK 5@   QHJL   - example line
  292. | |  | |  ||||
  293. 1 2  3 4  5678   -references
  294.               
  295. References:
  296. 1 - North's length and qualifyer for the current suit
  297. 2 - North's card pattern for that suit
  298. 3 - South's length and qualifyer
  299. 4 - South's card pattern
  300. 5 - Missing card to finesse against
  301. 6 - Hand to lead from (S=Declarer, N=Dummy, X=don't consider a finesse)
  302. 7 - Card to lead (L=Low, H=high,T=Ten, J=Jack, etc.)    
  303. 8 - Card for partner to play if lead not covered by the missing card.
  304.  
  305. The preference rules apply here as well.  This file should be enlarged to
  306. cover many more situations.
  307.  
  308.  
  309. PROMOTE.PR  - Rules for selecting suits for promotion of high cards
  310.  
  311. This file is also used once for every suit, so there are no suit qualifyers
  312.  
  313. 4+KQ 1+X  Y  - example line
  314. | |  | |  |    
  315. 1 2  3 4  5  - reference
  316.  
  317. References:
  318. 1 - North's length and qualifyer for the suit
  319. 2 - North's card pattern
  320. 3 - South's length and qualifyer
  321. 4 - South's card pattern
  322. 5 - Promote flag (Y=Yes promote this suit, N=No, don't)
  323.  
  324.  
  325. LONG.PR -  Rules for selecting suits for establishment of small cards.
  326.  
  327.  
  328. 4+AK 4+XX 5Y  - example line
  329. | |  | |  ||
  330. 1 2  3 4  56  - references
  331.  
  332. References:
  333.  
  334. 1 - North's length and qualifyer
  335. 2 - North's card pattern
  336. 3 - South's length and qualifyer
  337. 4 - South's card pattern
  338. 5 - Number of cards in opponents hands in this suit
  339. 6 - Establish flag (Y=Yes, play cards to establish small cards, N=no, don't)
  340.  
  341.  
  342. SHORT.PR  - Rules to select suits for possible ruffing (trumping) situations
  343.  
  344. 1@A  1-X  YH - example line
  345. | |  | |  ||
  346. 1 2  3 4  56 - references
  347.  
  348. References:
  349.  
  350. 1 - North's length and pattern for this suit
  351. 2 - North's card pattern
  352. 3 - South's length and pattern
  353. 4 - South's card pattern
  354. 5 - Ruffing flag ( Y=Yes ruffing potential, N=No don't consider)
  355. 6 - Hand that must have at least two trumps (S = South), N= North))
  356.  
  357.  
  358.  
  359.  
  360. CONCLUSION:
  361.  
  362. The above information may seem complicated and confusing, but after you
  363. work with a rule file for awhile, you will see that it is quite simple and
  364. logical. Remember, when you communicate with a computer, it is similar to
  365. instructing a two year old child. Instructions must be simple and usually
  366. repetitive. The computer searches through a data file one line at a time,
  367. so once again, the most specific rules must be first, followed by more
  368. general rules, so a rule that identifies a Spade pattern of "AKx" must be
  369. before a rule with a blank Spade pattern, and before a "xxx" Spade pattern.
  370.    
  371. Also remember that you don't need to get into rule modification if you don't
  372. want to.  Let other people do the work. I will upload another zip file on
  373. the Internet with the latest rules and systems for registered users. This
  374. file will probably be called BRIDGERL.ZIP.
  375. If anyone wants to send me a set of rules for testing, send them as an 
  376. attachment to a email message and send it to tslemko@island.net.
  377.  
  378.  
  379. GOOD LUCK!!!!
  380.  
  381. Tom Slemko, President,
  382. JTS Micro Consulting Ltd.
  383.  
  384.