-/* $NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $ */
+/* $NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $";
+__RCSID("$NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $");
#endif
#endif /* not lint */
#define NTV 10 /* number scores to test */
/* score to test reachability of, and order to test them in */
-int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
+const int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
/*
* computer chooses what to play in pegging...
*/
int
cchose(h, n, s)
- CARD h[];
+ const CARD h[];
int n, s;
{
- register int i, j, l;
+ int i, j, l;
if (n <= 1)
return (0);
*/
int
plyrhand(hand, s)
- CARD hand[];
- char *s;
+ const CARD hand[];
+ const char *s;
{
static char prompt[BUFSIZ];
- register int i, j;
- register BOOLEAN win;
+ int i, j;
+ BOOLEAN win;
prhand(hand, CINHAND, Playwin, FALSE);
(void) sprintf(prompt, "Your %s scores ", s);
*/
int
comphand(h, s)
- CARD h[];
- char *s;
+ const CARD h[];
+ const char *s;
{
- register int j;
+ int j;
j = scorehand(h, turnover, CINHAND, strcmp(s, "crib") == 0, FALSE);
prhand(h, CINHAND, Compwin, FALSE);
myturn = (scr == &cscore);
if (inc != 0) {
- prpeg(Lastscore[myturn], '.', myturn);
- Lastscore[myturn] = *scr;
+ prpeg(Lastscore[(int)myturn], '.', myturn);
+ Lastscore[(int)myturn] = *scr;
*scr += inc;
prpeg(*scr, PEG, myturn);
refresh();
*/
void
prpeg(score, peg, myturn)
- register int score;
+ int score;
int peg;
BOOLEAN myturn;
{
- register int y, x;
+ int y, x;
if (!myturn)
y = SCORE_Y + 2;
BOOLEAN mycrib;
{
CARD d[CARDS], h[FULLHAND], cb[2];
- register int i, j, k;
+ int i, j, k;
int nc, ns;
long sums[15];
static int undo1[15] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4};
*/
int
anymove(hand, n, sum)
- CARD hand[];
+ const CARD hand[];
int n, sum;
{
- register int i, j;
+ int i, j;
if (n < 1)
return (FALSE);
*/
int
anysumto(hand, n, s, t)
- CARD hand[];
+ const CARD hand[];
int n, s, t;
{
- register int i;
+ int i;
for (i = 0; i < n; i++) {
if (s + VAL(hand[i].rank) == t)
*/
int
numofval(h, n, v)
- CARD h[];
+ const CARD h[];
int n, v;
{
- register int i, j;
+ int i, j;
j = 0;
for (i = 0; i < n; i++) {
*/
void
makeknown(h, n)
- CARD h[];
+ const CARD h[];
int n;
{
- register int i;
+ int i;
for (i = 0; i < n; i++)
known[knownum++] = h[i];