summaryrefslogtreecommitdiffstats
path: root/backgammon/backgammon/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'backgammon/backgammon/main.c')
-rw-r--r--backgammon/backgammon/main.c80
1 files changed, 24 insertions, 56 deletions
diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c
index e019c8df..0a4ff8a2 100644
--- a/backgammon/backgammon/main.c
+++ b/backgammon/backgammon/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 1998/09/15 13:43:34 frueauf Exp $ */
+/* $NetBSD: main.c,v 1.9 1999/02/10 12:29:47 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.8 1998/09/15 13:43:34 frueauf Exp $");
+__RCSID("$NetBSD: main.c,v 1.9 1999/02/10 12:29:47 hubertf Exp $");
#endif
#endif /* not lint */
@@ -51,53 +51,42 @@ __RCSID("$NetBSD: main.c,v 1.8 1998/09/15 13:43:34 frueauf Exp $");
#include "backlocal.h"
#define MVPAUSE 5 /* time to sleep when stuck */
-#define MAXUSERS 35 /* maximum number of users */
-extern char *instr[]; /* text of instructions */
-extern char *message[]; /* update message */
+extern const char *const instr[]; /* text of instructions */
+extern const char *const message[]; /* update message */
speed_t ospeed; /* tty output speed */
-char *helpm[] = { /* help message */
+const char *const helpm[] = { /* help message */
"Enter a space or newline to roll, or",
" R to reprint the board\tD to double",
" S to save the game\tQ to quit",
0
};
-char *contin[] = { /* pause message */
+const char *const contin[] = { /* pause message */
"(Type a newline to continue.)",
"",
0
};
-#if 0
-static char user1a[] =
-"Sorry, you cannot play backgammon when there are more than ";
-static char user1b[] =
-" users\non the system.";
-static char user2a[] =
-"\nThere are now more than ";
-static char user2b[] =
-" users on the system, so you cannot play\nanother game. ";
-#endif
-static char rules[] = "\nDo you want the rules of the game?";
-static char noteach[] = "Teachgammon not available!\n\007";
-static char need[] = "Do you need instructions for this program?";
-static char askcol[] =
+static const char rules[] = "\nDo you want the rules of the game?";
+static const char noteach[] = "Teachgammon not available!\n\007";
+static const char need[] = "Do you need instructions for this program?";
+static const char askcol[] =
"Enter 'r' to play red, 'w' to play white, 'b' to play both:";
-static char rollr[] = "Red rolls a ";
-static char rollw[] = ". White rolls a ";
-static char rstart[] = ". Red starts.\n";
-static char wstart[] = ". White starts.\n";
-static char toobad1[] = "Too bad, ";
-static char unable[] = " is unable to use that roll.\n";
-static char toobad2[] = ". Too bad, ";
-static char cantmv[] = " can't move.\n";
-static char bgammon[] = "Backgammon! ";
-static char gammon[] = "Gammon! ";
-static char again[] = ".\nWould you like to play again?";
-static char svpromt[] = "Would you like to save this game?";
-
-static char password[] = "losfurng";
+static const char rollr[] = "Red rolls a ";
+static const char rollw[] = ". White rolls a ";
+static const char rstart[] = ". Red starts.\n";
+static const char wstart[] = ". White starts.\n";
+static const char toobad1[] = "Too bad, ";
+static const char unable[] = " is unable to use that roll.\n";
+static const char toobad2[] = ". Too bad, ";
+static const char cantmv[] = " can't move.\n";
+static const char bgammon[] = "Backgammon! ";
+static const char gammon[] = "Gammon! ";
+static const char again[] = ".\nWould you like to play again?";
+static const char svpromt[] = "Would you like to save this game?";
+
+static const char password[] = "losfurng";
static char pbuf[10];
int
@@ -121,16 +110,6 @@ main(argc, argv)
raw.c_lflag &= ~ICANON; /* set up modes */
ospeed = cfgetospeed(&old); /* for termlib */
- /* check user count */
-#ifdef CORY
- if (ucount() > MAXUSERS) {
- writel(user1a);
- wrint(MAXUSERS);
- writel(user1b);
- getout(0);
- }
-#endif
-
/* get terminal capabilities, and decide if it can cursor address */
tflag = getcaps(getenv("TERM"));
/* use whole screen for text */
@@ -519,17 +498,6 @@ main(argc, argv)
/* write score */
wrscore();
- /* check user count */
-#ifdef CORY
- if (ucount() > MAXUSERS) {
- writel(user2a);
- wrint(MAXUSERS);
- writel(user2b);
- rfl = 1;
- break;
- }
-#endif
-
/* see if he wants another game */
writel(again);
if ((i = yorn('S')) == 0)