-/* $NetBSD: cards.c,v 1.4 1997/10/10 12:32:22 lukem Exp $ */
+/* $NetBSD: cards.c,v 1.8 2005/07/02 08:32:32 jmc Exp $ */
/*-
* Copyright (c) 1980, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.4 1997/10/10 12:32:22 lukem Exp $");
+__RCSID("$NetBSD: cards.c,v 1.8 2005/07/02 08:32:32 jmc Exp $");
#endif
#endif /* not lint */
* Initialize a deck of cards to contain one of each type.
*/
void
-makedeck(d)
- CARD d[];
+makedeck(CARD d[])
{
int i, j, k;
* see Knuth, vol. 2, page 125.
*/
void
-shuffle(d)
- CARD d[];
+shuffle(CARD d[])
{
int j, k;
CARD c;
* return true if the two cards are equal...
*/
int
-eq(a, b)
- CARD a, b;
+eq(CARD a, CARD b)
{
return ((a.rank == b.rank) && (a.suit == b.suit));
}
/*
- * isone returns TRUE if a is in the set of cards b
+ * is_one returns TRUE if a is in the set of cards b
*/
int
-isone(a, b, n)
- CARD a, b[];
- int n;
+is_one(CARD a, const CARD b[], int n)
{
int i;
* remove the card a from the deck d of n cards
*/
void
-cremove(a, d, n)
- CARD a, d[];
- int n;
+cremove(CARD a, CARD d[], int n)
{
int i, j;
* Sort a hand of n cards
*/
void
-sorthand(h, n)
- CARD h[];
- int n;
+sorthand(CARD h[], int n)
{
CARD *cp, *endp;
CARD c;