summaryrefslogtreecommitdiffstats
path: root/cribbage
diff options
context:
space:
mode:
authorphil <phil@NetBSD.org>1997-07-09 06:25:45 +0000
committerphil <phil@NetBSD.org>1997-07-09 06:25:45 +0000
commit6170d87a62457fdea2faa68464de66f4ff98e654 (patch)
tree08d0f49c1c40a8c17be2572d2e74ed5b13dcf463 /cribbage
parent03a482de46e4ac8ada13b90965720fcfe97c003e (diff)
downloadbsdgames-darwin-6170d87a62457fdea2faa68464de66f4ff98e654.tar.gz
bsdgames-darwin-6170d87a62457fdea2faa68464de66f4ff98e654.tar.zst
bsdgames-darwin-6170d87a62457fdea2faa68464de66f4ff98e654.zip
Clean up play, let player see play more often, improve display timing.
Preliminary work from PR 2055 (as reverse patches).
Diffstat (limited to 'cribbage')
-rw-r--r--cribbage/crib.c16
-rw-r--r--cribbage/io.c6
2 files changed, 18 insertions, 4 deletions
diff --git a/cribbage/crib.c b/cribbage/crib.c
index 96bfe568..145083b2 100644
--- a/cribbage/crib.c
+++ b/cribbage/crib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: crib.c,v 1.5 1995/03/21 15:08:42 cgd Exp $ */
+/* $NetBSD: crib.c,v 1.6 1997/07/09 06:25:45 phil Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: crib.c,v 1.5 1995/03/21 15:08:42 cgd Exp $";
+static char rcsid[] = "$NetBSD: crib.c,v 1.6 1997/07/09 06:25:45 phil Exp $";
#endif
#endif /* not lint */
@@ -226,10 +226,13 @@ game()
} else
compcrib = (deck[i].rank > deck[j].rank);
} while (flag);
+ do_wait();
clear();
makeboard();
refresh();
} else {
+ makeboard();
+ refresh();
werase(Tablewin);
wrefresh(Tablewin);
werase(Compwin);
@@ -287,6 +290,9 @@ playhand(mycrib)
register int deckpos;
werase(Compwin);
+ wrefresh(Compwin);
+ werase(Tablewin);
+ wrefresh(Tablewin);
knownum = 0;
deckpos = deal(mycrib);
@@ -427,6 +433,7 @@ prcrib(mycrib, blank)
for (y = CRIB_Y; y <= CRIB_Y + 5; y++)
mvaddstr(y, cardx, " ");
+ refresh();
}
/*
@@ -473,6 +480,7 @@ peg(mycrib)
else { /* give him his point */
msg(quiet ? "You get one" :
"You get one point");
+ do_wait();
if (chkscr(&pscore, 1))
return TRUE;
sum = 0;
@@ -550,6 +558,8 @@ peg(mycrib)
if (i > 0) {
msg(quiet ? "You got %d" :
"You got %d points", i);
+ if (pnum == 0)
+ do_wait();
if (chkscr(&pscore, i))
return TRUE;
}
@@ -580,6 +590,7 @@ peg(mycrib)
} else {
msg(quiet ? "You get one for last" :
"You get one point for last");
+ do_wait();
if (chkscr(&pscore, 1))
return TRUE;
}
@@ -616,6 +627,7 @@ score(mycrib)
do_wait();
if (comphand(crib, "crib"))
return (TRUE);
+ do_wait();
} else {
if (comphand(chand, "hand"))
return (TRUE);
diff --git a/cribbage/io.c b/cribbage/io.c
index a1ebe3dc..452a3ecf 100644
--- a/cribbage/io.c
+++ b/cribbage/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.8 1997/05/17 19:26:18 pk Exp $ */
+/* $NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: io.c,v 1.8 1997/05/17 19:26:18 pk Exp $";
+static char rcsid[] = "$NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $";
#endif
#endif /* not lint */
@@ -407,6 +407,7 @@ msg(fmt, va_alist)
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ Newpos = strlen(Msgbuf);
va_end(ap);
endmsg();
}
@@ -432,6 +433,7 @@ addmsg(fmt, va_alist)
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ Newpos = strlen(Msgbuf);
va_end(ap);
}