-/* $NetBSD: subs.c,v 1.18 2012/10/13 18:44:15 dholland Exp $ */
+/* $NetBSD: subs.c,v 1.20 2013/09/13 20:46:50 joerg Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subs.c,v 1.18 2012/10/13 18:44:15 dholland Exp $");
+__RCSID("$NetBSD: subs.c,v 1.20 2013/09/13 20:46:50 joerg Exp $");
#endif
#endif /* not lint */
static const char plwhite[] = "Player is white, computer is red.";
static const char nocomp[] = "(No computer play.)";
-static const char *const descr[] = {
- "Usage: backgammon [-] [n r w b pr pw pb t3a]\n",
- "\t-\tgets this list\n\tn\tdon't ask for rules or instructions",
- "\tr\tplayer is red (implies n)\n\tw\tplayer is white (implies n)",
- "\tb\ttwo players, red and white (implies n)",
- "\tpr\tprint the board before red's turn",
- "\tpw\tprint the board before white's turn",
- "\tpb\tprint the board before both player's turn",
- "\tterm\tterminal is a term",
- "\tsfile\trecover saved game from file",
- 0
-};
-
void
errexit(const char *s)
{
}
void
-proll(void)
+proll(struct move *mm)
{
- struct move *mm = &gm;
-
if (mm->d0)
mswap(mm);
if (cturn == 1)
}
int
-quit(void)
+quit(struct move *mm)
{
if (tflag) {
if (rfl) {
writel("Would you like to save this game?");
if (yorn(0))
- save(0);
+ save(mm, 0);
}
cturn = 0;
return (1);
}
void
-getarg(char ***arg)
+getarg(struct move *mm, char ***arg)
{
char **s;
writel("No save file named\n");
getout(0);
} else
- recover(s[0]);
+ recover(mm, s[0]);
break;
}
s++;
}
if (s[0] != 0)
- recover(s[0]);
+ recover(mm, s[0]);
}
void
}
void
-roll(void)
+roll(struct move *mm)
{
char c;
int row;
int col;
- struct move *mm = &gm;
row = col = 0;
if (iroll) {