SCCS-vsn: games/cribbage/crib.c 1.17
SCCS-vsn: games/cribbage/io.c 1.12
SCCS-vsn: games/cribbage/support.c 1.14
SCCS-vsn: games/cribbage/score.c 1.4
-static char *sccsid = "@(#)crib.c 1.16 (Berkeley) %G%";
+static char *sccsid = "@(#)crib.c 1.17 (Berkeley) %G%";
# include <curses.h>
# include <signal.h>
# include <curses.h>
# include <signal.h>
-/*
- * bye:
- * Leave the program, cleaning things up as we go.
- */
-bye()
-{
- signal(SIGINT, SIG_IGN);
- mvcur(0, COLS - 1, LINES - 1, 0);
- fflush(stdout);
- endwin();
- putchar('\n');
- exit(1);
-}
-
/*
* makeboard:
* Print out the initial board on the screen
/*
* makeboard:
* Print out the initial board on the screen
-static char *sccsid = "@(#)io.c 1.11 (Berkeley) %G%";
+static char *sccsid = "@(#)io.c 1.12 (Berkeley) %G%";
# include <curses.h>
# include <ctype.h>
# include <curses.h>
# include <ctype.h>
# include <unctrl.h>
# include "deck.h"
# include "cribbage.h"
# include <unctrl.h>
# include "deck.h"
# include "cribbage.h"
stdscr = oscr;
return linebuf;
}
stdscr = oscr;
return linebuf;
}
+
+/*
+ * bye:
+ * Leave the program, cleaning things up as we go.
+ */
+bye()
+{
+ signal(SIGINT, SIG_IGN);
+ mvcur(0, COLS - 1, LINES - 1, 0);
+ fflush(stdout);
+ endwin();
+ putchar('\n');
+ exit(1);
+}
-static char *sccsid = "@(#)score.c 1.3 (Berkeley) %G%";
+#
+static char *sccsid = "@(#)score.c 1.4 (Berkeley) %G%";
#include <stdio.h>
#include "deck.h"
#include <stdio.h>
#include "deck.h"
CARD h[(CINHAND + 1)];
register int i, k;
register int score;
CARD h[(CINHAND + 1)];
register int i, k;
register int score;
char buf[32];
expl[0] = NULL; /* initialize explanation */
score = 0;
char buf[32];
expl[0] = NULL; /* initialize explanation */
score = 0;
k = hand[0].suit;
for (i = 0; i < n; i++) { /* check for flush */
flag = (flag && (hand[i].suit == k));
k = hand[0].suit;
for (i = 0; i < n; i++) { /* check for flush */
flag = (flag && (hand[i].suit == k));
-static char *sccsid = "@(#)support.c 1.13 (Berkeley) %G%";
+static char *sccsid = "@(#)support.c 1.14 (Berkeley) %G%";
#include <curses.h>
#include "deck.h"
#include <curses.h>
#include "deck.h"
prhand(hand, CINHAND, Playwin, FALSE);
sprintf(prompt, "Your %s scores ", s);
prhand(hand, CINHAND, Playwin, FALSE);
sprintf(prompt, "Your %s scores ", s);
- i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib"), explain);
+ i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain);
if ((j = number(0, 29, prompt)) == 19)
j = 0;
if (i != j) {
if ((j = number(0, 29, prompt)) == 19)
j = 0;
if (i != j) {
- j = scorehand(h, turnover, CINHAND, FALSE, FALSE);
+ j = scorehand(h, turnover, CINHAND, strcmp(s, "crib") == 0, FALSE);
prhand(h, CINHAND, Compwin, FALSE);
msg("My %s scores %d", s, (j == 0 ? 19 : j));
return chkscr(&cscore, j);
prhand(h, CINHAND, Compwin, FALSE);
msg("My %s scores %d", s, (j == 0 ? 19 : j));
return chkscr(&cscore, j);