xref: /csrg-svn/games/battlestar/misc.c (revision 69066)
118723Sedward /*
260750Sbostic  * Copyright (c) 1983, 1993
360750Sbostic  *	The Regents of the University of California.  All rights reserved.
434234Sbostic  *
542569Sbostic  * %sccs.include.redist.c%
618723Sedward  */
718723Sedward 
817387Sedward #ifndef lint
9*69066Sbostic static char sccsid[] = "@(#)misc.c	8.2 (Berkeley) 04/28/95";
1034234Sbostic #endif /* not lint */
1117387Sedward 
12*69066Sbostic #include "extern.h"
1317387Sedward 
card(array,size)1417387Sedward card(array, size)		/* for beenthere, injuries */
1517387Sedward 	register char *array;
1617387Sedward 	int size;
1717387Sedward {
1817387Sedward 	register char *end = array + size;
1917387Sedward 	register int i = 0;
2017387Sedward 
2117387Sedward 	while (array < end)
2217387Sedward 		if (*array++)
2317387Sedward 			i++;
2417387Sedward 	return (i);
2517387Sedward }
2617387Sedward 
ucard(array)2717387Sedward ucard(array)
2817387Sedward 	register unsigned *array;
2917387Sedward {
3017387Sedward 	register int j = 0, n;
3117387Sedward 
3217387Sedward 	for (n = 0; n < NUMOFOBJECTS; n++)
3317387Sedward 		if (testbit(array, n))
3417387Sedward 			    j++;
3517387Sedward 	return (j);
3617387Sedward }
37