summaryrefslogtreecommitdiffstats
path: root/backgammon/teachgammon/data.c
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1999-02-10 12:29:47 +0000
committerhubertf <hubertf@NetBSD.org>1999-02-10 12:29:47 +0000
commitf2e552ba9ea473d3399e7b124077a7e4a856138b (patch)
treece3f13ceac941baa50c07a090d8cbd73be7fda90 /backgammon/teachgammon/data.c
parent19bd733c3aad11dcfb4bbcf06abf79ff64442032 (diff)
downloadbsdgames-darwin-f2e552ba9ea473d3399e7b124077a7e4a856138b.tar.gz
bsdgames-darwin-f2e552ba9ea473d3399e7b124077a7e4a856138b.tar.zst
bsdgames-darwin-f2e552ba9ea473d3399e7b124077a7e4a856138b.zip
The patch below makes the game backgammon(6) use `const' where
appropriate. It also removes some obsolete, unused code to check the number of users on the system (obsoleted by dm); removes a prototype for an unused function that was removed earlier; and removes a control character from one message that was I think intended to clear the screen on some particular terminal (though I can't find the comment to that effect in any of the BSD source trees I have handy) but no longer serves any useful purpose. From PR 6580 by Joseph Myers <jsm28@cam.ac.uk>. Also contains two more patches, one in teachgammon/tutor.h (by Joseph) and one in common_source/fancy.c (by me).
Diffstat (limited to 'backgammon/teachgammon/data.c')
-rw-r--r--backgammon/teachgammon/data.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/backgammon/teachgammon/data.c b/backgammon/teachgammon/data.c
index 94b1d43e..8af936d5 100644
--- a/backgammon/teachgammon/data.c
+++ b/backgammon/teachgammon/data.c
@@ -1,4 +1,4 @@
-/* $NetBSD: data.c,v 1.4 1997/10/10 08:59:51 lukem Exp $ */
+/* $NetBSD: data.c,v 1.5 1999/02/10 12:29:48 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: data.c,v 1.4 1997/10/10 08:59:51 lukem Exp $");
+__RCSID("$NetBSD: data.c,v 1.5 1999/02/10 12:29:48 hubertf Exp $");
#endif
#endif /* not lint */
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: data.c,v 1.4 1997/10/10 08:59:51 lukem Exp $");
int maxmoves = 23;
-char *text0[] = {
+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",
@@ -54,7 +54,7 @@ char *text0[] = {
0
};
-char *text1[] = {
+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-",
@@ -62,7 +62,7 @@ char *text1[] = {
0
};
-char *text2[] = {
+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",
@@ -75,7 +75,7 @@ char *text2[] = {
0
};
-char *text3[] = {
+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",
@@ -84,13 +84,13 @@ char *text3[] = {
0
};
-char *text4[] = {
+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
};
-char *text5[] = {
+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-17. It leaves me with",
"one man still open, but the blot is farther back on the board, and",
@@ -98,7 +98,7 @@ char *text5[] = {
0
};
-char *text6[] = {
+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",
@@ -106,7 +106,7 @@ char *text6[] = {
0
};
-char *text7[] = {
+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",
@@ -114,27 +114,27 @@ char *text7[] = {
0
};
-char *text8[] = {
+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
};
-char *text9[] = {
+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 0-1,1-2,15-14,15-14.",
0
};
-char *text10[] = {
+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
};
-char *text11[] = {
+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",
@@ -142,20 +142,20 @@ char *text11[] = {
0
};
-char *text12[] = {
+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
};
-char *text13[] = {
+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
};
-char *text14[] = {
+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",
@@ -164,25 +164,25 @@ char *text14[] = {
0
};
-char *text15[] = {
+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
};
-char *text16[] = {
+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
};
-char *text17[] = {
+const char *const text17[] = {
"It pays to spread out your men. I roll 3 5 and move 7-4,8-3.",
0
};
-char *text18[] = {
+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",
@@ -190,30 +190,30 @@ char *text18[] = {
0
};
-char *text19[] = {
+const char *const text19[] = {
"I roll 1 4 and move 5-4,4-0.",
0
};
-char *text20[] = {
+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
};
-char *text21[] = {
+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
};
-char *text22[] = {
+const char *const text22[] = {
"It looks pretty hopeless for me, but I play on, rolling 1 3 and",
"moving 4-3,3-0.",
0
};
-char *text23[] = {
+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",
@@ -222,7 +222,7 @@ char *text23[] = {
0
};
-struct situatn test[] = {
+const struct situatn test[] = {
{
{0, 2, 0, 0, 0, 0, -5, 0, -3, 0, 0, 0, 5, -5, 0, 0, 0, 3, 0,
5, 0, 0, 0, 0, -2, 0},