Home | History | Annotate | Line # | Download | only in cribbage
cribbage.h revision 1.6.2.1
      1  1.6.2.1  wrstuden /*	$NetBSD: cribbage.h,v 1.6.2.1 1999/12/27 18:28:59 wrstuden Exp $	*/
      2      1.3       cgd 
      3      1.1       cgd /*
      4      1.3       cgd  * Copyright (c) 1980, 1993
      5      1.3       cgd  *	The Regents of the University of California.  All rights reserved.
      6      1.1       cgd  *
      7      1.1       cgd  * Redistribution and use in source and binary forms, with or without
      8      1.1       cgd  * modification, are permitted provided that the following conditions
      9      1.1       cgd  * are met:
     10      1.1       cgd  * 1. Redistributions of source code must retain the above copyright
     11      1.1       cgd  *    notice, this list of conditions and the following disclaimer.
     12      1.1       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     13      1.1       cgd  *    notice, this list of conditions and the following disclaimer in the
     14      1.1       cgd  *    documentation and/or other materials provided with the distribution.
     15      1.1       cgd  * 3. All advertising materials mentioning features or use of this software
     16      1.1       cgd  *    must display the following acknowledgement:
     17      1.1       cgd  *	This product includes software developed by the University of
     18      1.1       cgd  *	California, Berkeley and its contributors.
     19      1.1       cgd  * 4. Neither the name of the University nor the names of its contributors
     20      1.1       cgd  *    may be used to endorse or promote products derived from this software
     21      1.1       cgd  *    without specific prior written permission.
     22      1.1       cgd  *
     23      1.1       cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24      1.1       cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25      1.1       cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26      1.1       cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27      1.1       cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28      1.1       cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29      1.1       cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30      1.1       cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31      1.1       cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32      1.1       cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33      1.1       cgd  * SUCH DAMAGE.
     34      1.1       cgd  *
     35      1.3       cgd  *	@(#)cribbage.h	8.1 (Berkeley) 5/31/93
     36      1.1       cgd  */
     37      1.1       cgd 
     38      1.1       cgd extern  CARD		deck[ CARDS ];		/* a deck */
     39      1.1       cgd extern  CARD		phand[ FULLHAND ];	/* player's hand */
     40      1.1       cgd extern  CARD		chand[ FULLHAND ];	/* computer's hand */
     41      1.1       cgd extern  CARD		crib[ CINHAND ];	/* the crib */
     42      1.1       cgd extern  CARD		turnover;		/* the starter */
     43      1.1       cgd 
     44      1.1       cgd extern  CARD		known[ CARDS ];		/* cards we have seen */
     45      1.1       cgd extern  int		knownum;		/* # of cards we know */
     46      1.1       cgd 
     47      1.1       cgd extern  int		pscore;			/* player's score */
     48      1.1       cgd extern  int		cscore;			/* comp's score */
     49      1.1       cgd extern  int		glimit;			/* points to win game */
     50      1.1       cgd 
     51      1.1       cgd extern  int		pgames;			/* player's games won */
     52      1.1       cgd extern  int		cgames;			/* comp's games won */
     53      1.1       cgd extern  int		gamecount;		/* # games played */
     54      1.1       cgd extern	int		Lastscore[2];		/* previous score for each */
     55      1.1       cgd 
     56      1.1       cgd extern  BOOLEAN		iwon;			/* if comp won last */
     57      1.1       cgd extern  BOOLEAN		explain;		/* player mistakes explained */
     58      1.1       cgd extern  BOOLEAN		rflag;			/* if all cuts random */
     59      1.1       cgd extern  BOOLEAN		quiet;			/* if suppress random mess */
     60      1.1       cgd extern	BOOLEAN		playing;		/* currently playing game */
     61      1.1       cgd 
     62      1.1       cgd extern  char		expl[];			/* string for explanation */
     63      1.1       cgd 
     64      1.3       cgd void	 addmsg __P((const char *, ...));
     65      1.5       jsm int	 adjust __P((const CARD [], CARD));
     66      1.5       jsm int	 anymove __P((const CARD [], int, int));
     67      1.5       jsm int	 anysumto __P((const CARD [], int, int, int));
     68      1.3       cgd void	 bye __P((void));
     69      1.5       jsm int	 cchose __P((const CARD [], int, int));
     70      1.3       cgd void	 cdiscard __P((BOOLEAN));
     71      1.3       cgd int	 chkscr __P((int *, int));
     72      1.5       jsm int	 comphand __P((const CARD [], const char *));
     73      1.3       cgd void	 cremove __P((CARD, CARD [], int));
     74      1.3       cgd int	 cut __P((BOOLEAN, int));
     75      1.3       cgd int	 deal __P((int));
     76      1.3       cgd void	 discard __P((BOOLEAN));
     77      1.3       cgd void	 do_wait __P((void));
     78      1.3       cgd void	 endmsg __P((void));
     79      1.3       cgd int	 eq __P((CARD, CARD));
     80      1.5       jsm int	 fifteens __P((const CARD [], int));
     81      1.3       cgd void	 game __P((void));
     82      1.3       cgd void	 gamescore __P((void));
     83      1.3       cgd char	*getline __P((void));
     84      1.3       cgd int	 getuchar __P((void));
     85      1.3       cgd int	 incard __P((CARD *));
     86      1.5       jsm int	 infrom __P((const CARD [], int, const char *));
     87      1.3       cgd void	 instructions __P((void));
     88  1.6.2.1  wrstuden int	 is_one __P((CARD, const CARD [], int));
     89      1.3       cgd void	 makeboard __P((void));
     90      1.3       cgd void	 makedeck __P((CARD []));
     91      1.5       jsm void	 makeknown __P((const CARD [], int));
     92      1.3       cgd void	 msg __P((const char *, ...));
     93      1.3       cgd int	 msgcard __P((CARD, BOOLEAN));
     94      1.5       jsm int	 msgcrd __P((CARD, BOOLEAN, const char *, BOOLEAN));
     95      1.5       jsm int	 number __P((int, int, const char *));
     96      1.5       jsm int	 numofval __P((const CARD [], int, int));
     97      1.5       jsm int	 pairuns __P((const CARD [], int));
     98      1.3       cgd int	 peg __P((BOOLEAN));
     99      1.5       jsm int	 pegscore __P((CARD, const CARD [], int, int));
    100      1.3       cgd int	 playhand __P((BOOLEAN));
    101      1.5       jsm int	 plyrhand __P((const CARD [], const char *));
    102      1.3       cgd void	 prcard __P((WINDOW *, int, int, CARD, BOOLEAN));
    103      1.3       cgd void	 prcrib __P((BOOLEAN, BOOLEAN));
    104      1.5       jsm void	 prhand __P((const CARD [], int, WINDOW *, BOOLEAN));
    105      1.3       cgd void	 printcard __P((WINDOW *, int, CARD, BOOLEAN));
    106      1.3       cgd void	 prpeg __P((int, int, BOOLEAN));
    107      1.3       cgd void	 prtable __P((int));
    108      1.3       cgd int	 readchar __P((void));
    109      1.4   hubertf void	 rint __P((int)) __attribute__((__noreturn__));
    110      1.3       cgd int	 score __P((BOOLEAN));
    111      1.5       jsm int	 scorehand __P((const CARD [], CARD, int, BOOLEAN, BOOLEAN));
    112      1.3       cgd void	 shuffle __P((CARD []));
    113      1.3       cgd void	 sorthand __P((CARD [], int));
    114      1.3       cgd void	 wait_for __P((int));
    115