summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-12-10 16:21:50 +0000
committerbillf <billf@FreeBSD.org>1999-12-10 16:21:50 +0000
commita0aeba94d4c4ff749b9f7e5dd71dcfa5ee1f60c5 (patch)
tree0c280e7b4b18e96e1caf08d55afc79948c9b6ec2 /games
parent72299511da25816c5666e95bc59450973c25980e (diff)
downloadFreeBSD-src-a0aeba94d4c4ff749b9f7e5dd71dcfa5ee1f60c5.zip
FreeBSD-src-a0aeba94d4c4ff749b9f7e5dd71dcfa5ee1f60c5.tar.gz
-Wall cleanup.
Diffstat (limited to 'games')
-rw-r--r--games/fish/fish.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/games/fish/fish.c b/games/fish/fish.c
index 08a6e02..bc1572e 100644
--- a/games/fish/fish.c
+++ b/games/fish/fish.c
@@ -56,6 +56,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "pathnames.h"
#define RANKS 13
@@ -76,6 +77,23 @@ int promode;
int asked[RANKS], comphand[RANKS], deck[RANKS];
int userasked[RANKS], userhand[RANKS];
+void chkwinner __P((int player, int *hand));
+int compmove __P((void));
+int countbooks __P((int *hand));
+int countcards __P((int *hand));
+int drawcard __P((int player, int *hand));
+int gofish __P((int askedfor, int player, int *hand));
+void goodmove __P((int player, int move, int *hand, int *opphand));
+void init __P((void));
+void instructions __P((void));
+int nrandom __P((int n));
+void printhand __P((int *hand));
+void printplayer __P((int player));
+int promove __P((void));
+void usage __P((void));
+int usermove __P((void));
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -125,8 +143,10 @@ istart: for (;;) {
}
}
/* NOTREACHED */
+ return(EXIT_FAILURE);
}
+int
usermove()
{
int n;
@@ -181,6 +201,7 @@ usermove()
/* NOTREACHED */
}
+int
compmove()
{
static int lmove;
@@ -198,6 +219,7 @@ compmove()
return(lmove);
}
+int
promove()
{
int i, max;
@@ -236,6 +258,7 @@ promove()
/* NOTREACHED */
}
+int
drawcard(player, hand)
int player;
int *hand;
@@ -258,6 +281,7 @@ drawcard(player, hand)
return(card);
}
+int
gofish(askedfor, player, hand)
int askedfor, player;
int *hand;
@@ -274,6 +298,7 @@ gofish(askedfor, player, hand)
return(0);
}
+void
goodmove(player, move, hand, opphand)
int player, move;
int *hand, *opphand;
@@ -297,6 +322,7 @@ goodmove(player, move, hand, opphand)
(void)printf("get another guess!\n");
}
+void
chkwinner(player, hand)
int player;
int *hand;
@@ -326,6 +352,7 @@ chkwinner(player, hand)
exit(0);
}
+void
printplayer(player)
int player;
{
@@ -339,6 +366,7 @@ printplayer(player)
}
}
+void
printhand(hand)
int *hand;
{
@@ -359,6 +387,7 @@ printhand(hand)
(void)putchar('\n');
}
+int
countcards(hand)
int *hand;
{
@@ -369,6 +398,7 @@ countcards(hand)
return(count);
}
+int
countbooks(hand)
int *hand;
{
@@ -385,6 +415,7 @@ countbooks(hand)
return(count);
}
+void
init()
{
int i, rank;
@@ -403,14 +434,15 @@ init()
}
}
+int
nrandom(n)
int n;
{
- long random();
return((int)random() % n);
}
+void
instructions()
{
int input;
@@ -428,6 +460,7 @@ instructions()
while ((input = getchar()) != EOF && input != '\n');
}
+void
usage()
{
(void)fprintf(stderr, "usage: fish [-p]\n");
OpenPOWER on IntegriCloud