DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T n

⟦d61a4cfa7⟧ TextFile

    Length: 801 (0x321)
    Types: TextFile
    Names: »nobs.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Nobs/nobs.c« 

TextFile

/*
 *	nobs - play cribbage.
 */

#include <stdio.h>
#include "defs.h"
#include "globs.h"

extern	int	programdiscard();
extern	int	humandiscard();

usage()
{
#ifdef	NOHINT
	fprintf(stderr,"usage: nobs [-v]\n");
#else
	fprintf(stderr,"usage: nobs [-h] [-v]\n");
#endif
	exit(-1);
}

main(argc,argv)
int argc;
char **argv;
{
	while (--argc) {
		if ('-'==**++argv) switch(*++*argv) {
		case 'v':
			printf("Nobs Version %s\n", version);
			exit(0);
#ifndef	NOHINT
		case 'h':
			hflag = 1;
			break;
#endif
		default:
			usage();
		}
		else break;
	}
	if (argc) usage();
	initrand();
	initwins();
	dealer = randint(2);
	playertype[0] = PROGRAM;
	playertype[1] = HUMAN;
	dscfunc[PROGRAM] = programdiscard;
	dscfunc[HUMAN] = humandiscard;
	for (quitflag=0; !quitflag; ) playgame();
	termwins();
	exit(0);
}