SCCS-vsn: games/cribbage/cards.c 5.5
SCCS-vsn: games/cribbage/crib.c 5.6
SCCS-vsn: games/cribbage/instr.c 5.2
SCCS-vsn: games/cribbage/io.c 5.8
SCCS-vsn: games/cribbage/support.c 5.6
SCCS-vsn: games/hangman/hangman.h 5.5
SCCS-vsn: games/hangman/main.c 5.4
-static char sccsid[] = "@(#)cards.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)cards.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <stdio.h>
#endif /* not lint */
#include <stdio.h>
* remove the card a from the deck d of n cards
*/
* remove the card a from the deck d of n cards
*/
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)crib.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)crib.c 5.6 (Berkeley) %G%";
#endif /* not lint */
# include <sys/signal.h>
#endif /* not lint */
# include <sys/signal.h>
prompt = (quiet ? "Discard --> " : "Discard a card --> ");
cdiscard(mycrib); /* puts best discard at end */
crd = phand[infrom(phand, FULLHAND, prompt)];
prompt = (quiet ? "Discard --> " : "Discard a card --> ");
cdiscard(mycrib); /* puts best discard at end */
crd = phand[infrom(phand, FULLHAND, prompt)];
- remove(crd, phand, FULLHAND);
+ cremove(crd, phand, FULLHAND);
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)];
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);
+ cremove(crd, phand, FULLHAND - 1);
prhand(phand, FULLHAND, Playwin, FALSE);
crib[1] = crd;
crib[2] = chand[4];
prhand(phand, FULLHAND, Playwin, FALSE);
crib[1] = crd;
crib[2] = chand[4];
if (j < 0) /* if nothing scores */
j = cchose(ch, cnum, sum);
crd = ch[j];
if (j < 0) /* if nothing scores */
j = cchose(ch, cnum, sum);
crd = ch[j];
- remove(crd, ch, cnum--);
+ cremove(crd, ch, cnum--);
sum += VAL(crd.rank);
Table[Tcnt++] = crd;
if (k > 0) {
sum += VAL(crd.rank);
Table[Tcnt++] = crd;
if (k > 0) {
msg("Total > 31 -- try again");
}
makeknown(&crd, 1);
msg("Total > 31 -- try again");
}
makeknown(&crd, 1);
- remove(crd, ph, pnum--);
+ cremove(crd, ph, pnum--);
i = pegscore(crd, Table, Tcnt, sum);
sum += VAL(crd.rank);
Table[Tcnt++] = crd;
i = pegscore(crd, Table, Tcnt, sum);
sum += VAL(crd.rank);
Table[Tcnt++] = crd;
-static char sccsid[] = "@(#)instr.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)instr.c 5.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/errno.h>
#include <sys/stat.h>
#endif /* not lint */
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/errno.h>
#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
#include "pathnames.h"
instructions()
#include "pathnames.h"
instructions()
extern int errno;
struct stat sb;
union wait pstat;
extern int errno;
struct stat sb;
union wait pstat;
- pid_t pid, waitpid();
- char *pager, *path, *getenv(), *rindex(), *strerror();
+ pid_t pid;
+ char *pager, *path;
if (stat(_PATH_INSTR, &sb)) {
(void)fprintf(stderr, "cribbage: %s: %s.\n", _PATH_INSTR,
if (stat(_PATH_INSTR, &sb)) {
(void)fprintf(stderr, "cribbage: %s: %s.\n", _PATH_INSTR,
- pid = waitpid(pid, &pstat, 0);
+ pid = waitpid(pid, (int *)&pstat, 0);
} while (pid == -1 && errno == EINTR);
if (pid == -1 || pstat.w_status)
exit(1);
} while (pid == -1 && errno == EINTR);
if (pid == -1 || pstat.w_status)
exit(1);
-static char sccsid[] = "@(#)io.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)io.c 5.8 (Berkeley) %G%";
#endif /* not lint */
# include <curses.h>
#endif /* not lint */
# include <curses.h>
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
- (void)vsprintf(Msgbuf[Newpos], fmt, ap);
+ (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
- (void)vsprintf(Msgbuf[Newpos], fmt, ap);
+ (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
-static char sccsid[] = "@(#)support.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)support.c 5.6 (Berkeley) %G%";
#endif /* not lint */
#include <curses.h>
#endif /* not lint */
#include <curses.h>
makedeck( d );
nc = CARDS;
for( i = 0; i < knownum; i++ ) { /* get all other cards */
makedeck( d );
nc = CARDS;
for( i = 0; i < knownum; i++ ) { /* get all other cards */
- remove( known[i], d, nc-- );
+ cremove( known[i], d, nc-- );
}
for( i = 0; i < 15; i++ ) sums[i] = 0L;
ns = 0;
}
for( i = 0; i < 15; i++ ) sums[i] = 0L;
ns = 0;
for( j = i + 1; j < FULLHAND; j++ ) {
cb[1] = chand[j];
for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
for( j = i + 1; j < FULLHAND; j++ ) {
cb[1] = chand[j];
for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
- remove( chand[i], h, FULLHAND );
- remove( chand[j], h, FULLHAND - 1 );
+ cremove( chand[i], h, FULLHAND );
+ cremove( chand[j], h, FULLHAND - 1 );
for( k = 0; k < nc; k++ ) {
sums[ns] += scorehand( h, d[k], CINHAND, TRUE, FALSE );
if( mycrib ) sums[ns] += adjust( cb, d[k] );
for( k = 0; k < nc; k++ ) {
sums[ns] += scorehand( h, d[k], CINHAND, TRUE, FALSE );
if( mycrib ) sums[ns] += adjust( cb, d[k] );
j = 0;
for( i = 1; i < 15; i++ ) if( sums[i] > sums[j] ) j = i;
for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
j = 0;
for( i = 1; i < 15; i++ ) if( sums[i] > sums[j] ) j = i;
for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
- remove( h[ undo1[j] ], chand, FULLHAND );
- remove( h[ undo2[j] ], chand, FULLHAND - 1 );
+ cremove( h[ undo1[j] ], chand, FULLHAND );
+ cremove( h[ undo2[j] ], chand, FULLHAND - 1 );
chand[4] = h[ undo1[j] ];
chand[5] = h[ undo2[j] ];
}
chand[4] = h[ undo1[j] ];
chand[5] = h[ undo2[j] ];
}
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hangman.h 5.4 (Berkeley) %G%
+ * @(#)hangman.h 5.5 (Berkeley) %G%
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.4 (Berkeley) %G%";
#endif /* not lint */
# include "hangman.h"
#endif /* not lint */
# include "hangman.h"
initscr();
signal(SIGINT, die);
setup();
initscr();
signal(SIGINT, die);
setup();
* die:
* Die properly.
*/
* die:
* Die properly.
*/
die()
{
mvcur(0, COLS - 1, LINES - 1, 0);
die()
{
mvcur(0, COLS - 1, LINES - 1, 0);