summaryrefslogtreecommitdiffstats
path: root/backgammon/teachgammon
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/teachgammon
parent653e85afa892eacbbdb9b34fd73115cc38be3911 (diff)
downloadbsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.tar.gz
bsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.tar.zst
bsdgames-darwin-e0b4b2e87c96803d2d4d74cad54f16eb1d15a8d9.zip
sprinkle static
Diffstat (limited to 'backgammon/teachgammon')
-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
4 files changed, 38 insertions, 37 deletions
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__));