4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / games / battlestar / misc.c
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* %sccs.include.redist.c%
*/
#ifndef lint
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) %G%";
#endif /* not lint */
#include "externs.h"
card(array, size) /* for beenthere, injuries */
register char *array;
int size;
{
register char *end = array + size;
register int i = 0;
while (array < end)
if (*array++)
i++;
return (i);
}
ucard(array)
register unsigned *array;
{
register int j = 0, n;
for (n = 0; n < NUMOFOBJECTS; n++)
if (testbit(array, n))
j++;
return (j);
}