summaryrefslogtreecommitdiffstats
path: root/backgammon
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 05:17:57 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 05:17:57 +0000
commite0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9 (patch)
tree750e4d7083e19c9557737d01e5226e39e8377e56 /backgammon
parent653e85afa892eacbbdb9b34fd73115cc38be3911 (diff)
downloadbsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.tar.gz
bsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.tar.zst
bsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.zip
sprinkle static
Diffstat (limited to 'backgammon')
-rw-r--r--backgammon/backgammon/backlocal.h7
-rw-r--r--backgammon/backgammon/extra.c8
-rw-r--r--backgammon/backgammon/main.c8
-rw-r--r--backgammon/backgammon/move.c20
-rw-r--r--backgammon/common_source/back.h12
-rw-r--r--backgammon/common_source/board.c8
-rw-r--r--backgammon/common_source/fancy.c56
-rw-r--r--backgammon/common_source/one.c11
-rw-r--r--backgammon/common_source/save.c8
-rw-r--r--backgammon/common_source/subs.c8
-rw-r--r--backgammon/common_source/table.c13
-rw-r--r--backgammon/teachgammon/data.c52
-rw-r--r--backgammon/teachgammon/teach.c8
-rw-r--r--backgammon/teachgammon/tutor.c11
-rw-r--r--backgammon/teachgammon/tutor.h4
15 files changed, 124 insertions, 110 deletions
diff --git a/backgammon/backgammon/backlocal.h b/backgammon/backgammon/backlocal.h
index 572eeab5..ae9a78b4 100644
--- a/backgammon/backgammon/backlocal.h
+++ b/backgammon/backgammon/backlocal.h
@@ -1,4 +1,4 @@
-/* $NetBSD: backlocal.h,v 1.3 2008/04/28 20:22:53 martin Exp $ */
+/* $NetBSD: backlocal.h,v 1.4 2009/08/12 05:17:57 dholland Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,11 +31,6 @@
void dble(void);
int dblgood(void);
-int eval(void);
int freemen(int);
-void movcmp(void);
void move(int);
-int movegood(void);
-void pickmove(void);
int trapped(int, int);
-void trymove(int, int);
diff --git a/backgammon/backgammon/extra.c b/backgammon/backgammon/extra.c
index 4b932568..2297f337 100644
--- a/backgammon/backgammon/extra.c
+++ b/backgammon/backgammon/extra.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: extra.c,v 1.7 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)extra.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: extra.c,v 1.7 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -45,6 +45,8 @@ __RCSID("$NetBSD: extra.c,v 1.6 2005/07/01 01:12:39 jmc Exp $");
FILE *trace;
#endif
+static int eval(void);
+
/*
* dble()
* Have the current player double and ask opponent to accept.
@@ -231,7 +233,7 @@ trapped(int n, int inc)
return (ct / 5);
}
-int
+static int
eval(void)
{
int i, j;
diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c
index cd762296..a68c67ad 100644
--- a/backgammon/backgammon/main.c
+++ b/backgammon/backgammon/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.26 2009/08/12 04:51:11 dholland Exp $ */
+/* $NetBSD: main.c,v 1.27 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.26 2009/08/12 04:51:11 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.27 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -54,14 +54,14 @@ extern const char *const instr[]; /* text of instructions */
extern const char *const message[]; /* update message */
extern short ospeed; /* tty output speed */
-const char *const helpm[] = { /* help message */
+static 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
};
-const char *const contin[] = { /* pause message */
+static const char *const contin[] = { /* pause message */
"(Type a newline to continue.)",
"",
0
diff --git a/backgammon/backgammon/move.c b/backgammon/backgammon/move.c
index 2ee0a34f..e04b71ed 100644
--- a/backgammon/backgammon/move.c
+++ b/backgammon/backgammon/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.9 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: move.c,v 1.10 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.9 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: move.c,v 1.10 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -55,8 +55,8 @@ struct BOARD { /* structure of game position */
struct BOARD *b_next; /* forward queue pointer */
};
-struct BOARD *freeq = 0;
-struct BOARD *checkq = 0;
+static struct BOARD *freeq = 0;
+static struct BOARD *checkq = 0;
/* these variables are values for the candidate move */
static int ch; /* chance of being hit */
@@ -90,6 +90,10 @@ static void boardcopy(struct BOARD *);
static void makefree(struct BOARD *);
static void mvcheck(struct BOARD *, struct BOARD *);
static struct BOARD *nextfree(void);
+static void trymove(int, int);
+static void pickmove(void);
+static void movcmp(void);
+static int movegood(void);
/* zero if first move */
@@ -183,7 +187,7 @@ move(int okay)
/* mvnum == number of move (rel zero) */
/* swapped == see if swapped also tested */
-void
+static void
trymove(int mvnum, int swapped)
{
int pos; /* position on board */
@@ -361,7 +365,7 @@ nextfree(void)
return (new);
}
-void
+static void
pickmove(void)
{
/* current game position */
@@ -402,7 +406,7 @@ boardcopy(struct BOARD *s)
}
}
-void
+static void
movcmp(void)
{
int i;
@@ -476,7 +480,7 @@ movcmp(void)
#endif
}
-int
+static int
movegood(void)
{
int n;
diff --git a/backgammon/common_source/back.h b/backgammon/common_source/back.h
index 557cfc6b..fe8737c6 100644
--- a/backgammon/common_source/back.h
+++ b/backgammon/common_source/back.h
@@ -1,4 +1,4 @@
-/* $NetBSD: back.h,v 1.15 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: back.h,v 1.16 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -131,22 +131,17 @@ extern int begscr; /* 'beginning' of screen
int addbuf(int);
void backone(int);
-void bsect(int, int, int, int);
void buflush(void);
int canhit(int, int);
-int checkd(int);
int checkmove(int);
void clear(void);
void clend(void);
void cline(void);
int count(void);
void curmove(int, int);
-int dotable(int, int);
void errexit(const char *) __attribute__((__noreturn__));
void fancyc(int);
void fboard(void);
-void fixcol(int, int, int, int, int);
-void fixpos(int, int, int, int, int);
void fixtty(struct termios *);
void getarg(char ***);
int getcaps(const char *);
@@ -154,17 +149,14 @@ void getmove(void);
void getout(int) __attribute__((__noreturn__));
void gwrite(void);
void init(void);
-int last(void);
int main(int, char *[]);
int makmove(int);
int movallow(void);
void movback(int);
void moverr(int);
int movokay(int);
-void newline(void);
void newpos(void);
void nexturn(void);
-void norec(const char *) __attribute__((__noreturn__));
void odds(int, int, int);
void proll(void);
int quit(void);
@@ -172,11 +164,9 @@ int readc(void);
void recover(const char *);
void refresh(void);
void roll(void);
-int rsetbrd(void);
void save(int);
int text(const char *const *);
void wrboard(void);
-void wrbsub(void);
void wrhit(int);
void wrint(int);
void writec(int);
diff --git a/backgammon/common_source/board.c b/backgammon/common_source/board.c
index 1c76eddb..2c52ea69 100644
--- a/backgammon/common_source/board.c
+++ b/backgammon/common_source/board.c
@@ -1,4 +1,4 @@
-/* $NetBSD: board.c,v 1.8 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: board.c,v 1.9 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: board.c,v 1.8 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: board.c,v 1.9 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -43,6 +43,8 @@ __RCSID("$NetBSD: board.c,v 1.8 2005/07/01 01:12:39 jmc Exp $");
static int i, j, k;
static char ln[60];
+static void wrbsub(void);
+
void
wrboard(void)
{
@@ -160,7 +162,7 @@ lastline:
fixtty(&raw);
}
-void
+static void
wrbsub(void)
{
int m;
diff --git a/backgammon/common_source/fancy.c b/backgammon/common_source/fancy.c
index fcbeabb4..9116e0ad 100644
--- a/backgammon/common_source/fancy.c
+++ b/backgammon/common_source/fancy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fancy.c,v 1.13 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,12 +34,24 @@
#if 0
static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fancy.c,v 1.13 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
+static void bsect(int, int, int, int);
+static void fixpos(int, int, int, int, int);
+static void fixcol(int, int, int, int, int);
+static void newline(void);
+
+/*
+ * These need to be declared so they come out as commons, because
+ * termcap might or might not define some of them. Our termcap defines
+ * PC, BC, and UP only. This is gross.
+ *
+ * XXX: rewrite this crap using curses.
+ */
char PC; /* padding character */
char *BC; /* backspace sequence */
char *CD; /* clear to end of screen sequence */
@@ -52,33 +64,33 @@ char *ML; /* row cursor movement map */
char *ND; /* forward cursor sequence */
char *UP; /* up cursor sequence */
-int lHO; /* length of HO */
-int lBC; /* length of BC */
-int lND; /* length of ND */
-int lUP; /* length of UP */
-int CO; /* number of columns */
-int LI; /* number of lines */
-int *linect; /* array of lengths of lines on screen (the
+static int lHO; /* length of HO */
+static int lBC; /* length of BC */
+static int lND; /* length of ND */
+static int lUP; /* length of UP */
+static int CO; /* number of columns */
+static int LI; /* number of lines */
+static int *linect; /* array of lengths of lines on screen (the
* actual screen is not stored) */
/* two letter codes */
-char tcap[] = "bccdceclcmhomcmlndup";
+static char tcap[] = "bccdceclcmhomcmlndup";
/* corresponding strings */
-char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
+static char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
int buffnum; /* pointer to output buffer */
-char tbuf[1024]; /* buffer for decoded termcap entries */
+static char tbuf[1024]; /* buffer for decoded termcap entries */
-int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0};
+static int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0};
-int oldr;
-int oldw;
+static int oldr;
+static int oldw;
/* "real" cursor positions, so it knows when to reposition. These are -1 if
* curr and curc are accurate */
-int realr;
-int realc;
+static int realr;
+static int realc;
void
fboard(void)
@@ -187,7 +199,7 @@ fboard(void)
* to see if the position is a player's home, since those are printed
* differently.
*/
-void
+static void
bsect(int b, int rpos, int cpos, int cnext)
{
int j; /* index */
@@ -294,7 +306,7 @@ refresh(void)
buflush();
}
-void
+static void
fixpos(int cur, int new, int r, int c, int inc)
{
int o, n, nv;
@@ -380,7 +392,7 @@ fixpos(int cur, int new, int r, int c, int inc)
fixcol(r + inc * new, c + 1, abs(cur + new), ' ', inc);
}
-void
+static void
fixcol(int r, int c, int l, int ch, int inc)
{
int i;
@@ -683,7 +695,7 @@ cline(void)
}
}
-void
+static void
newline(void)
{
cline();
diff --git a/backgammon/common_source/one.c b/backgammon/common_source/one.c
index dde3096a..215a1890 100644
--- a/backgammon/common_source/one.c
+++ b/backgammon/common_source/one.c
@@ -1,4 +1,4 @@
-/* $NetBSD: one.c,v 1.6 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: one.c,v 1.7 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,12 +34,15 @@
#if 0
static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: one.c,v 1.6 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: one.c,v 1.7 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
+static int checkd(int);
+static int last(void);
+
int
makmove(int i)
{
@@ -115,7 +118,7 @@ moverr(int i)
}
-int
+static int
checkd(int d)
{
if (d0 != d)
@@ -123,7 +126,7 @@ checkd(int d)
return (0);
}
-int
+static int
last(void)
{
int i;
diff --git a/backgammon/common_source/save.c b/backgammon/common_source/save.c
index b6f6a30f..2e7f29c1 100644
--- a/backgammon/common_source/save.c
+++ b/backgammon/common_source/save.c
@@ -1,4 +1,4 @@
-/* $NetBSD: save.c,v 1.12 2006/03/18 23:25:30 christos Exp $ */
+/* $NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.12 2006/03/18 23:25:30 christos Exp $");
+__RCSID("$NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -53,6 +53,8 @@ static const char type[] = "'.\nType \"backgammon ";
static const char rec[] = "\" to recover your game.\n\n";
static const char cantrec[] = "Can't recover file: ";
+static void norec(const char *) __attribute__((__noreturn__));
+
void
save(int n)
{
@@ -164,7 +166,7 @@ recover(const char *s)
rflag = 1;
}
-void
+static void
norec(const char *s)
{
const char *c;
diff --git a/backgammon/common_source/subs.c b/backgammon/common_source/subs.c
index 62529fe0..aa139222 100644
--- a/backgammon/common_source/subs.c
+++ b/backgammon/common_source/subs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subs.c,v 1.16 2007/12/15 19:44:39 perry Exp $ */
+/* $NetBSD: subs.c,v 1.17 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,20 +34,20 @@
#if 0
static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subs.c,v 1.16 2007/12/15 19:44:39 perry Exp $");
+__RCSID("$NetBSD: subs.c,v 1.17 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
int buffnum;
-char outbuff[BUFSIZ];
+static char outbuff[BUFSIZ];
static const char plred[] = "Player is red, computer is white.";
static const char plwhite[] = "Player is white, computer is red.";
static const char nocomp[] = "(No computer play.)";
-const char *const descr[] = {
+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)",
diff --git a/backgammon/common_source/table.c b/backgammon/common_source/table.c
index 1b817dca..869d802e 100644
--- a/backgammon/common_source/table.c
+++ b/backgammon/common_source/table.c
@@ -1,4 +1,4 @@
-/* $NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $ */
+/* $NetBSD: table.c,v 1.10 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,13 +34,13 @@
#if 0
static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $");
+__RCSID("$NetBSD: table.c,v 1.10 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
-const char *const help2[] = {
+static const char *const help2[] = {
" Enter moves as <s>-<f> or <s>/<r> where <s> is the starting",
"position, <f> is the finishing position, and <r> is the roll.",
"Remember, each die roll must be moved separately.",
@@ -77,6 +77,9 @@ static const struct state atmata[] = {
{'\n', 0, -1}, {'.', 0, 0}
};
+static int dotable(int, int);
+static int rsetbrd(void);
+
int
checkmove(int ist)
{
@@ -194,7 +197,7 @@ dochar:
goto dochar;
}
-int
+static int
dotable(int c, int i)
{
int a;
@@ -288,7 +291,7 @@ dotable(int c, int i)
return (-5);
}
-int
+static int
rsetbrd(void)
{
int i, j, n;
diff --git a/backgammon/teachgammon/data.c b/backgammon/teachgammon/data.c
index 189066e8..c06c7cc6 100644
--- a/backgammon/teachgammon/data.c
+++ b/backgammon/teachgammon/data.c
@@ -1,4 +1,4 @@
-/* $NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $ */
+/* $NetBSD: data.c,v 1.8 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $");
+__RCSID("$NetBSD: data.c,v 1.8 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -42,7 +42,7 @@ __RCSID("$NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $");
int maxmoves = 23;
-const char *const text0[] = {
+static const char *const text0[] = {
"To start the game, I roll a 3, and you roll a 1. This means",
"that I get to start first. I move 8-5,6-5 since this makes a",
"new point and helps to trap your back men on 1. You should be",
@@ -50,7 +50,7 @@ const char *const text0[] = {
0
};
-const char *const text1[] = {
+static const char *const text1[] = {
"Now you shall see a move using doubles. I just rolled double",
"5's. I will move two men from position 13 to position 3. The",
"notation for this is 13-8,13-8,8-3,8-3. You will also roll dou-",
@@ -58,7 +58,7 @@ const char *const text1[] = {
0
};
-const char *const text2[] = {
+static const char *const text2[] = {
"Excellent! As you can see, you are beginning to develop a wall",
"which is trapping my men on position 24. Also, moving your back",
"men forward not only improves your board position safely, but it",
@@ -71,7 +71,7 @@ const char *const text2[] = {
0
};
-const char *const text3[] = {
+static const char *const text3[] = {
"As you can see, although you left a man open, it is a rela-",
"tively safe move to an advantageous position, which might help",
"you make a point later. Only two rolls (4 5 or 5 4) will allow",
@@ -80,13 +80,13 @@ const char *const text3[] = {
0
};
-const char *const text4[] = {
+static const char *const text4[] = {
"You're pretty lucky yourself, you know. I follow by rolling 2 3",
"and moving 25-22,24-22, forming a new point.",
0
};
-const char *const text5[] = {
+static const char *const text5[] = {
"Not a spectacular move, but a safe one. I follow by rolling 6 1.",
"I decide to use this roll to move 22-16,16-15. It leaves me with",
"one man still open, but the blot is farther back on the board, and",
@@ -94,7 +94,7 @@ const char *const text5[] = {
0
};
-const char *const text6[] = {
+static const char *const text6[] = {
"By moving your two men from 17 to 20, you lessen my chance of",
"getting my man off the board. In fact, the odds are 5 to 4",
"against me getting off. I roll with the odds and helplessly",
@@ -102,7 +102,7 @@ const char *const text6[] = {
0
};
-const char *const text7[] = {
+static const char *const text7[] = {
"Note that the blot on 7 cannot be hit unless I get off the bar",
"and have a 1 or a 6 left over, and doing so will leave two of",
"my men open. Also, the blot on 16 cannot be hit at all! With",
@@ -110,27 +110,27 @@ const char *const text7[] = {
0
};
-const char *const text8[] = {
+static const char *const text8[] = {
"See, you did not get hit and, you got to 'cover up' your open men.",
"Quite an accomplishment. Finally, I get off the bar by rolling",
"6 2 and moving 25-23,23-17.",
0
};
-const char *const text9[] = {
+static const char *const text9[] = {
"My venture off the bar did not last long. However, I got lucky",
"and rolled double 1's, allowing me to move 25-24,24-23,15-14,15-14.",
0
};
-const char *const text10[] = {
+static const char *const text10[] = {
"You are improving your position greatly and safely, and are well",
"on the way to winning the game. I roll a 6 2 and squeak past",
"your back man. Now the game becomes a race to the finish.",
0
};
-const char *const text11[] = {
+static const char *const text11[] = {
"Now that it is merely a race, you are trying to get as many men",
"as possible into the inner table, so you can start removing them.",
"I roll a 3 4 and move my two men farthest back to position 11",
@@ -138,20 +138,20 @@ const char *const text11[] = {
0
};
-const char *const text12[] = {
+static const char *const text12[] = {
"The race is still on, and you have seem to be doing all right.",
"I roll 6 1 and move 14-8,13-12.",
0
};
-const char *const text13[] = {
+static const char *const text13[] = {
"Notice that you get to remove men the instant you have all of",
"them at your inner table, even if it is the middle of a turn.",
"I roll 1 2 and move 13-11,12-11.",
0
};
-const char *const text14[] = {
+static const char *const text14[] = {
"Although you could have removed a man, this move illustrates two",
"points: 1) You never have to remove men, and 2) You should try",
"to spread out your men on your inner table. Since you have one",
@@ -160,25 +160,25 @@ const char *const text14[] = {
0
};
-const char *const text15[] = {
+static const char *const text15[] = {
"This time you were able to remove men. I roll 3 4 and move",
"11-7,11-8. The race continues.",
0
};
-const char *const text16[] = {
+static const char *const text16[] = {
"More holes are opening up in your inner table, but you are",
"still very much ahead. If we were doubling, you would have",
"doubled long ago. I roll 2 6 and move 8-6,11-5.",
0
};
-const char *const text17[] = {
+static const char *const text17[] = {
"It pays to spread out your men. I roll 3 5 and move 7-4,8-3.",
0
};
-const char *const text18[] = {
+static const char *const text18[] = {
"You can only remove some men, but you spread out more and",
"more, in order to be able to remove men more efficiently.",
"I roll double 3's, which help, but not that much. I move",
@@ -186,30 +186,30 @@ const char *const text18[] = {
0
};
-const char *const text19[] = {
+static const char *const text19[] = {
"I roll 1 4 and move 5-4,4-0.",
0
};
-const char *const text20[] = {
+static const char *const text20[] = {
"You are now nicely spread out to win a game. I roll 5 6 and",
"move 5-0,6-0.",
0
};
-const char *const text21[] = {
+static const char *const text21[] = {
"Any minute now. Just a few short steps from victory. I roll",
"2 4 and move 6-4,4-0.",
0
};
-const char *const text22[] = {
+static const char *const text22[] = {
"It looks pretty hopeless for me, but I play on, rolling 1 3 and",
"moving 4-3,3-0.",
0
};
-const char *const text23[] = {
+static const char *const text23[] = {
"Congratulations! You just won a game of backgammon against the",
"computer! You will now be able to play a game, but remember,",
"when you start playing, that doubling will be enabled, which",
diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c
index 8df8730c..5c654b3f 100644
--- a/backgammon/teachgammon/teach.c
+++ b/backgammon/teachgammon/teach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.19 2008/07/20 01:03:20 lukem Exp $ */
+/* $NetBSD: teach.c,v 1.20 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,14 +39,14 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.19 2008/07/20 01:03:20 lukem Exp $");
+__RCSID("$NetBSD: teach.c,v 1.20 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
#include "back.h"
#include "tutor.h"
-const char *const helpm[] = {
+static const char *const helpm[] = {
"\nEnter a space or newline to roll, or",
" b to display the board",
" d to double",
@@ -54,7 +54,7 @@ const char *const helpm[] = {
0
};
-const char *const contin[] = {
+static const char *const contin[] = {
"",
0
};
diff --git a/backgammon/teachgammon/tutor.c b/backgammon/teachgammon/tutor.c
index 0af7100e..a5b0a4c9 100644
--- a/backgammon/teachgammon/tutor.c
+++ b/backgammon/teachgammon/tutor.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tutor.c,v 1.7 2005/07/01 01:12:39 jmc Exp $ */
+/* $NetBSD: tutor.c,v 1.8 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tutor.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: tutor.c,v 1.7 2005/07/01 01:12:39 jmc Exp $");
+__RCSID("$NetBSD: tutor.c,v 1.8 2009/08/12 05:17:57 dholland Exp $");
#endif
#endif /* not lint */
@@ -44,6 +44,9 @@ __RCSID("$NetBSD: tutor.c,v 1.7 2005/07/01 01:12:39 jmc Exp $");
static const char better[] =
"That is a legal move, but there is a better one.\n";
+static int brdeq(const int *, const int *);
+static void clrest(void);
+
void
tutor(void)
{
@@ -129,7 +132,7 @@ tutor(void)
leave();
}
-void
+static void
clrest(void)
{
int r, c, j;
@@ -143,7 +146,7 @@ clrest(void)
curmove(r, c);
}
-int
+static int
brdeq(const int *b1, const int *b2)
{
const int *e;
diff --git a/backgammon/teachgammon/tutor.h b/backgammon/teachgammon/tutor.h
index 6fcceffd..ca5d2d1b 100644
--- a/backgammon/teachgammon/tutor.h
+++ b/backgammon/teachgammon/tutor.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tutor.h,v 1.8 2004/01/27 20:30:28 jsm Exp $ */
+/* $NetBSD: tutor.h,v 1.9 2009/08/12 05:17:57 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -62,7 +62,5 @@ extern const char *const stragy[];
extern const struct situatn test[];
-int brdeq(const int *, const int *);
-void clrest(void);
void leave(void) __attribute__((__noreturn__));
void tutor(void) __attribute__((__noreturn__));