home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume13
/
okbridge
/
part07
/
scoring.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-12
|
3KB
|
90 lines
/* scoring.h -- scoring functions for the bridge program.
!
! Copyright (C) 1990,1991 by Matthew Clegg
!
! This program may be copied and distributed freely. Please do not
! charge money for this program or for any program derived from it.
! If you modify this program, then include a notice stating plainly
! that your program is derived from the okbridge program and is not
! the same as the official okbridge program.
!
! I welcome any suggestions for improvement to okbridge, and
! I would be especially happy to receive improved source code.
! If you have comments or suggestions, or if you would like to
! join the okbridge mailing list, then write to
!
! mclegg@cs.ucsd.edu
!
*
* This file defines the functions used for computing scores.
* We provide functions for scoring according to the rules of
* rubber bridge as well as according to the rules of Chicago style
* bridge. Instead of being passed parameters, these functions
* obtain most of their information from the global variables
* defined in globals.h.
*
* I would like to thank Tom Kronmiller for supplying the code
* for scoring according to the Chicago rules. Thanks Tom!
*/
extern int Rubber_score_above ();
/* int Rubber_score_above (int extra); */
/* Computes the above-the-line score for the current contract assuming
* that 'extra' many tricks below the required number were taken.
* Returns the score.
*/
extern int Rubber_score_below ();
/* int Rubber_score_below (void); */
/* Computes the below-the-line score for the current contract,
* assuming that it was made.
*/
extern int Rubber_score_set ();
/* int Rubber_score_set (int down); */
/* Computes the penalty score for the current contract assuming that
* 'down' too few tricks were taken. Returns the score.
*/
extern int Chicago_score_made ();
/* int Chicago_score_made (int extra, int vulnerable); */
/* Computes the score for the current contract assuming that it was made
* and that an additional 'extra' tricks were taken. 'vulnerable' is a
* boolean flag which indicates whether the declaring team was
* vulnerable. Part_score is the 'part score' of the declaring team.
* The scoring is the same as for rubber bridge, except that bidding and
* making a game is worth 300 nonvulnerable or 500 vulnerable.
* Returns the score.
*
* Based on code written by Tom Kronmiller
*/
extern int Chicago_score_set ();
/* int Chicago_score_set (int down, int vulnerable); */
/* Computes the score for the current contract assuming that it was
* set and that 'down' too few tricks were taken. 'vulnerable' is
* a boolean flag which indicates whether the declaring team was
* vulnerable. Returns the score.
*
* Based on code written by Tom Kronmiller
*/
extern int Duplicate_score_made ();
/* int Duplicate_score_made (int extra, int vulnerable); */
/* Computes the score for the current contract assuming that it was made
* and that an additional 'extra' tricks were taken. 'vulnerable' is a
* boolean flag which indicates whether the declaring team was
* vulnerable. Returns the score.
*/
extern int Duplicate_score_set ();
/* int Duplicate_score_set (int down, int vulnerable); */
/* Computes the score for the current contract assuming that it was
* set and that 'down' too few tricks were taken. 'vulnerable' is
* a boolean flag which indicates whether the declaring team was
* vulnerable. Returns the score.
*/