show back of computer's hand during play
authorKen Arnold <arnold@ucbvax.Berkeley.EDU>
Tue, 7 Sep 1982 05:59:14 +0000 (21:59 -0800)
committerKen Arnold <arnold@ucbvax.Berkeley.EDU>
Tue, 7 Sep 1982 05:59:14 +0000 (21:59 -0800)
SCCS-vsn: games/cribbage/io.c 1.6
SCCS-vsn: games/cribbage/crib.c 1.11
SCCS-vsn: games/cribbage/support.c 1.7

usr/src/games/cribbage/crib.c
usr/src/games/cribbage/io.c
usr/src/games/cribbage/support.c

index f962340..57ebc4a 100644 (file)
@@ -256,7 +256,7 @@ BOOLEAN             mycrib;
        sorthand(chand, FULLHAND);
        sorthand(phand, FULLHAND);
        makeknown(chand, FULLHAND);
        sorthand(chand, FULLHAND);
        sorthand(phand, FULLHAND);
        makeknown(chand, FULLHAND);
-       prhand(phand, FULLHAND, Playwin);
+       prhand(phand, FULLHAND, Playwin, FALSE);
        discard(mycrib);
        if (cut(mycrib, deckpos))
            return TRUE;
        discard(mycrib);
        if (cut(mycrib, deckpos))
            return TRUE;
@@ -309,12 +309,12 @@ BOOLEAN           mycrib;
        cdiscard(mycrib);                       /* puts best discard at end */
        crd = phand[infrom(phand, FULLHAND, prompt)];
        remove(crd, phand, FULLHAND);
        cdiscard(mycrib);                       /* puts best discard at end */
        crd = phand[infrom(phand, FULLHAND, prompt)];
        remove(crd, phand, FULLHAND);
-       prhand(phand, FULLHAND, Playwin);
+       prhand(phand, FULLHAND, Playwin, FALSE);
        crib[0] = crd;
 /* next four lines same as last four except for cdiscard() */
        crd = phand[infrom(phand, FULLHAND - 1, prompt)];
        remove(crd, phand, FULLHAND - 1);
        crib[0] = crd;
 /* next four lines same as last four except for cdiscard() */
        crd = phand[infrom(phand, FULLHAND - 1, prompt)];
        remove(crd, phand, FULLHAND - 1);
-       prhand(phand, FULLHAND, Playwin);
+       prhand(phand, FULLHAND, Playwin, FALSE);
        crib[1] = crd;
        crib[2] = chand[4];
        crib[3] = chand[5];
        crib[1] = crd;
        crib[2] = chand[4];
        crib[3] = chand[5];
@@ -413,7 +413,8 @@ BOOLEAN             mycrib;
        myturn = !mycrib;
        for (;;) {
            last = TRUE;                                /* enable last flag */
        myturn = !mycrib;
        for (;;) {
            last = TRUE;                                /* enable last flag */
-           prhand(ph, pnum, Playwin);
+           prhand(ph, pnum, Playwin, FALSE);
+           prhand(ch, cnum, Compwin, TRUE);
            prtable(sum);
            if (myturn) {                               /* my tyrn to play */
                if (!anymove(ch, cnum, sum)) {          /* if no card to play */
            prtable(sum);
            if (myturn) {                               /* my tyrn to play */
                if (!anymove(ch, cnum, sum)) {          /* if no card to play */
@@ -487,7 +488,7 @@ BOOLEAN             mycrib;
                    }
                    else
                        for (;;) {
                    }
                    else
                        for (;;) {
-                           prhand(ph, pnum, Playwin);
+                           prhand(ph, pnum, Playwin, FALSE);
                            crd = ph[infrom(ph, pnum, "Your play: ")];
                            if (sum + VAL(crd.rank) <= 31)
                                break;
                            crd = ph[infrom(ph, pnum, "Your play: ")];
                            if (sum + VAL(crd.rank) <= 31)
                                break;
@@ -517,7 +518,8 @@ BOOLEAN             mycrib;
            if (!pnum && !cnum)
                break;                                  /* both done */
        }
            if (!pnum && !cnum)
                break;                                  /* both done */
        }
-       prhand(ph, pnum, Playwin);
+       prhand(ph, pnum, Playwin, FALSE);
+       prhand(ch, cnum, Compwin, TRUE);
        prtable(sum);
        if (last)
            if (played) {
        prtable(sum);
        if (last)
            if (played) {
@@ -541,7 +543,7 @@ BOOLEAN             mycrib;
 prtable(score)
 int    score;
 {
 prtable(score)
 int    score;
 {
-       prhand(Table, Tcnt, Tablewin);
+       prhand(Table, Tcnt, Tablewin, FALSE);
        mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score);
        wrefresh(Tablewin);
 }
        mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score);
        wrefresh(Tablewin);
 }
index a49ead5..316fa3b 100644 (file)
@@ -74,12 +74,13 @@ BOOLEAN             brfrank,  brfsuit;
  * printcard:
  *     Print out a card.
  */
  * printcard:
  *     Print out a card.
  */
-printcard(win, cardno, c)
+printcard(win, cardno, c, blank)
 WINDOW         *win;
 int            cardno;
 CARD           c;
 WINDOW         *win;
 int            cardno;
 CARD           c;
+BOOLEAN                blank;
 {
 {
-       prcard(win, cardno * 2, cardno, c, FALSE);
+       prcard(win, cardno * 2, cardno, c, blank);
 }
 
 /*
 }
 
 /*
@@ -111,16 +112,17 @@ BOOLEAN           blank;
  * prhand:
  *     Print a hand of n cards
  */
  * prhand:
  *     Print a hand of n cards
  */
-prhand(h, n, win)
+prhand(h, n, win, blank)
 CARD           h[];
 int            n;
 WINDOW         *win;
 CARD           h[];
 int            n;
 WINDOW         *win;
+BOOLEAN                blank;
 {
        register int    i;
 
        werase(win);
        for (i = 0; i < n; i++)
 {
        register int    i;
 
        werase(win);
        for (i = 0; i < n; i++)
-           printcard(win, i, h[i]);
+           printcard(win, i, *h++, blank);
        wrefresh(win);
 }
 
        wrefresh(win);
 }
 
index bcbb5a8..2352b99 100644 (file)
@@ -83,7 +83,7 @@ char          *s;
        BOOLEAN                 win;
        static char             prompt[BUFSIZ];
 
        BOOLEAN                 win;
        static char             prompt[BUFSIZ];
 
-       prhand(hand, CINHAND, Playwin);
+       prhand(hand, CINHAND, Playwin, FALSE);
        sprintf(prompt, "Your %s scores ", s);
        i = scorehand(hand, turnover, CINHAND, FALSE, explain); /* count */
        if ((j = number(0, 29, prompt)) == 19)
        sprintf(prompt, "Your %s scores ", s);
        i = scorehand(hand, turnover, CINHAND, FALSE, explain); /* count */
        if ((j = number(0, 29, prompt)) == 19)
@@ -118,7 +118,7 @@ char                *s;
        register int            j;
 
        j = scorehand(h, turnover, CINHAND, FALSE, FALSE);
        register int            j;
 
        j = scorehand(h, turnover, CINHAND, FALSE, FALSE);
-       prhand(h, CINHAND, Compwin);
+       prhand(h, CINHAND, Compwin, FALSE);
        Hasread = FALSE;
        msg("My %s scores %d", s, (j == 0 ? 19 : j));
        return chkscr(&cscore, j);
        Hasread = FALSE;
        msg("My %s scores %d", s, (j == 0 ? 19 : j));
        return chkscr(&cscore, j);