|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T e
Length: 2935 (0xb77) Types: TextFile Names: »exper.doc«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Bidding/exper.doc«
Bridge Bidder Version 3.0 by John Oswalt and Nathan Glasser ..!sun!megatest!jao (usenet) nathan@brokaw.lcs.mit.edu (internet) nathan@mit-eddie.uucp (usenet) June, 1989 ------------------------------------------------------------------------------ Copyright 1988, 1989 by Nathan Glasser and John Oswalt. You may feel free to distribute this program in its current form. Please do not remove this copyright information. ============================================================================== INTRODUCTION Bid works by dealing hands randomly, then throwing out deals which do not conform to specified criteria. The file exper.c contains code to implement very specific deals. Since frequently what you want to do is set one hand exactly (the one you held at the table), and to vary the others, a facility is provided to specify one hand, and let the program deal the other three randomly. (You can also set two, and have the program deal two.) HOW TO WRITE A NEW EXPERIMENT Copy exper.c to some safe place, and then modify it to implement your new problem. You must modify two routines. experiment_predeal() places specific cards in one (or two) hands, sets cardsused[] to indicate which cards have already been dealt out (so when the program deals out the other hands randomly, it doesn't use them again), hand_setup[] to indicate which hand has been pre-dealt, and decrements cardsleft. experiment_predeal() uses experiment_hand[] to set the set hand. If you are setting one hand, all you need to is modify this array's initialization. experiment_predeal() may be left as it is. The second routine, experimentq(), is harder to write. It is passed a pointer to a deal, and returns TRUE if the deal qualifies, and FALSE if it does not. pdeal->hand[0] is a pointer to the dealer's hand, pdeal->hand[1] to the second hand, etc. experimentq() makes calls to functions in eval.c to determine if the deal qualifies. See the source in eval.c for details. In the example experimentq(), we make sure that the dealer has less that 11 high card points, and does not have 6 hearts, 6 spades, or 7 clubs. (This approximates a non-opening hand.), Second hand is required to have 7 diamonds including the ace, not the spade ace, less than 11 HCP, no four card major, and not five clubs. This approximates a hand which might open 3 diamonds. Third hand is required to have 5 or 6 losers, and at least 5 spades. This approximates a hand which might overcall a second-seat 3D with 3S. The fourth hand is not checked, since it is the set hand. (See example.exp for the rationale for all this.) It is best to put the most restrictive tests first, for efficiency. EXAMPLE example.exp is a version of a usenet posting article by John Oswalt. It is an example of how one might use the program to investigate a bidding question. The exper.c file as distributed contains the code used to analyze this problem.