summaryrefslogtreecommitdiffstats
path: root/backgammon/teachgammon/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'backgammon/teachgammon/data.c')
-rw-r--r--backgammon/teachgammon/data.c179
1 files changed, 102 insertions, 77 deletions
diff --git a/backgammon/teachgammon/data.c b/backgammon/teachgammon/data.c
index 0c7b724c..94b1d43e 100644
--- a/backgammon/teachgammon/data.c
+++ b/backgammon/teachgammon/data.c
@@ -1,4 +1,4 @@
-/* $NetBSD: data.c,v 1.3 1995/03/21 15:06:10 cgd Exp $ */
+/* $NetBSD: data.c,v 1.4 1997/10/10 08:59:51 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -33,19 +33,20 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: data.c,v 1.3 1995/03/21 15:06:10 cgd Exp $";
+__RCSID("$NetBSD: data.c,v 1.4 1997/10/10 08:59:51 lukem Exp $");
#endif
-#endif /* not lint */
+#endif /* not lint */
#include "tutor.h"
-int maxmoves = 23;
+int maxmoves = 23;
-char *text0[] = {
+char *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",
@@ -53,7 +54,7 @@ char *text0[] = {
0
};
-char *text1[] = {
+char *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-",
@@ -61,7 +62,7 @@ char *text1[] = {
0
};
-char *text2[] = {
+char *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",
@@ -74,7 +75,7 @@ char *text2[] = {
0
};
-char *text3[] = {
+char *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",
@@ -83,13 +84,13 @@ char *text3[] = {
0
};
-char *text4[] = {
+char *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[] = {
+char *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",
@@ -97,7 +98,7 @@ char *text5[] = {
0
};
-char *text6[] = {
+char *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",
@@ -105,7 +106,7 @@ char *text6[] = {
0
};
-char *text7[] = {
+char *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",
@@ -113,27 +114,27 @@ char *text7[] = {
0
};
-char *text8[] = {
+char *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[] = {
+char *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[] = {
+char *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[] = {
+char *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",
@@ -141,20 +142,20 @@ char *text11[] = {
0
};
-char *text12[] = {
+char *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[] = {
+char *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[] = {
+char *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",
@@ -163,25 +164,25 @@ char *text14[] = {
0
};
-char *text15[] = {
+char *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[] = {
+char *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[] = {
+char *text17[] = {
"It pays to spread out your men. I roll 3 5 and move 7-4,8-3.",
0
};
-char *text18[] = {
+char *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",
@@ -189,30 +190,30 @@ char *text18[] = {
0
};
-char *text19[] = {
+char *text19[] = {
"I roll 1 4 and move 5-4,4-0.",
0
};
-char *text20[] = {
+char *text20[] = {
"You are now nicely spread out to win a game. I roll 5 6 and",
"move 5-0,6-0.",
0
};
-char *text21[] = {
+char *text21[] = {
"Any minute now. Just a few short steps from victory. I roll",
"2 4 and move 6-4,4-0.",
0
};
-char *text22[] = {
+char *text22[] = {
"It looks pretty hopeless for me, but I play on, rolling 1 3 and",
"moving 4-3,3-0.",
0
};
-char *text23[] = {
+char *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",
@@ -221,101 +222,125 @@ char *text23[] = {
0
};
-struct situatn test[] = {
+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},
- 3, 1, {8,6,0,0}, {5,5,0,0}, 4, 2, text0
+ {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},
+ 3, 1, {8, 6, 0, 0}, {5, 5, 0, 0}, 4, 2, {text0}
},
{
- {0,2,0,0,0,-2,-4,0,-2,0,0,0,5,-5,0,0,0,2,0,4,0,2,0,0,-2,0},
- 5, 5, {13,13,8,8}, {8,8,3,3}, 6, 6, text1
+ {0, 2, 0, 0, 0, -2, -4, 0, -2, 0, 0, 0, 5, -5, 0, 0, 0, 2, 0,
+ 4, 0, 2, 0, 0, -2, 0},
+ 5, 5, {13, 13, 8, 8}, {8, 8, 3, 3}, 6, 6, {text1}
},
{
- {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-3,0,0,0,2,2,4,0,2,0,0,-2,0},
- 6, 5, {13,8,0,0}, {8,2,0,0}, 1, 2, text2
+ {0, 0, 0, -2, 0, -2, -4, 2, -2, 0, 0, 0, 3, -3, 0, 0, 0, 2, 2,
+ 4, 0, 2, 0, 0, -2, 0},
+ 6, 5, {13, 8, 0, 0}, {8, 2, 0, 0}, 1, 2, {text2}
},
{
- {0,0,-1,-2,0,-2,-4,2,-2,0,0,0,2,-2,0,1,0,2,2,4,0,2,0,0,-2,0},
- 4, 5, {24,20,0,0}, {20,15,0,0}, 2, 5, text3
+ {0, 0, -1, -2, 0, -2, -4, 2, -2, 0, 0, 0, 2, -2, 0, 1, 0, 2,
+ 2, 4, 0, 2, 0, 0, -2, 0},
+ 4, 5, {24, 20, 0, 0}, {20, 15, 0, 0}, 2, 5, {text3}
},
{
- {0,0,0,-2,0,-2,-4,3,-2,0,0,0,2,-2,0,-1,0,2,2,4,0,2,0,0,-1,-1},
- 2, 3, {25,24,0,0}, {22,22,0,0}, 4, 1, text4
+ {0, 0, 0, -2, 0, -2, -4, 3, -2, 0, 0, 0, 2, -2, 0, -1, 0, 2,
+ 2, 4, 0, 2, 0, 0, -1, -1},
+ 2, 3, {25, 24, 0, 0}, {22, 22, 0, 0}, 4, 1, {text4}
},
{
- {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-2,0,-1,0,2,2,4,0,2,-2,0,0,0},
- 6, 1, {22,16,0,0}, {16,15,0,0}, 3, 3, text5
+ {0, 0, 0, -2, 0, -2, -4, 2, -2, 0, 0, 0, 3, -2, 0, -1, 0, 2,
+ 2, 4, 0, 2, -2, 0, 0, 0},
+ 6, 1, {22, 16, 0, 0}, {16, 15, 0, 0}, 3, 3, {text5}
},
{
- {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-2,0,-2,0,0,2,2,2,2,2,0,0,-1},
- 3, 5, {0,0,0,0}, {0,0,0,0}, 5, 4, text6
+ {0, 0, 0, -2, 0, -2, -4, 2, -2, 0, 0, 0, 3, -2, 0, -2, 0, 0,
+ 2, 2, 2, 2, 2, 0, 0, -1},
+ 3, 5, {0, 0, 0, 0}, {0, 0, 0, 0}, 5, 4, {text6}
},
{
- {0,0,0,-2,0,-2,-4,1,-2,0,0,0,3,-2,0,-2,1,0,2,2,2,2,2,0,0,-1},
- 6, 6, {0,0,0,0}, {0,0,0,0}, 3, 6, text7
+ {0, 0, 0, -2, 0, -2, -4, 1, -2, 0, 0, 0, 3, -2, 0, -2, 1, 0,
+ 2, 2, 2, 2, 2, 0, 0, -1},
+ 6, 6, {0, 0, 0, 0}, {0, 0, 0, 0}, 3, 6, {text7}
},
{
- {0,0,0,-2,0,-2,-4,0,-2,0,0,0,3,-2,0,-2,2,0,2,2,2,2,2,0,0,-1},
- 2, 6, {25,23,0,0}, {23,17,0,0}, 5, 1, text8
+ {0, 0, 0, -2, 0, -2, -4, 0, -2, 0, 0, 0, 3, -2, 0, -2, 2, 0,
+ 2, 2, 2, 2, 2, 0, 0, -1},
+ 2, 6, {25, 23, 0, 0}, {23, 17, 0, 0}, 5, 1, {text8}
},
{
- {0,0,0,-2,0,-2,-4,0,-2,0,0,0,2,-2,0,-2,2,0,3,2,2,2,2,0,0,-1},
- 1, 1, {25,24,15,15}, {24,23,14,14}, 4, 6, text9
+ {0, 0, 0, -2, 0, -2, -4, 0, -2, 0, 0, 0, 2, -2, 0, -2, 2, 0,
+ 3, 2, 2, 2, 2, 0, 0, -1},
+ 1, 1, {25, 24, 15, 15}, {24, 23, 14, 14}, 4, 6, {text9}
},
{
- {0,0,0,-2,0,-2,-4,0,-2,0,0,0,0,-2,-2,0,3,0,4,2,2,2,2,-1,0,0},
- 6, 2, {23,17,0,0}, {17,15,0,0}, 1, 3, text10
+ {0, 0, 0, -2, 0, -2, -4, 0, -2, 0, 0, 0, 0, -2, -2, 0, 3, 0,
+ 4, 2, 2, 2, 2, -1, 0, 0},
+ 6, 2, {23, 17, 0, 0}, {17, 15, 0, 0}, 1, 3, {text10}
},
{
- {0,0,0,-2,0,-2,-4,0,-2,0,0,0,0,-2,-2,-1,2,0,3,4,2,2,2,0,0,0},
- 4, 3, {15,14,0,0}, {11,11,0,0}, 5, 3, text11
+ {0, 0, 0, -2, 0, -2, -4, 0, -2, 0, 0, 0, 0, -2, -2, -1, 2, 0,
+ 3, 4, 2, 2, 2, 0, 0, 0},
+ 4, 3, {15, 14, 0, 0}, {11, 11, 0, 0}, 5, 3, {text11}
},
{
- {0,0,0,-2,0,-2,-4,0,-2,0,0,-2,0,-2,-1,0,0,0,3,5,2,3,2,0,0,0},
- 6, 1, {14,13,0,0}, {8,12,0,0}, 4, 4, text12
+ {0, 0, 0, -2, 0, -2, -4, 0, -2, 0, 0, -2, 0, -2, -1, 0, 0, 0,
+ 3, 5, 2, 3, 2, 0, 0, 0},
+ 6, 1, {14, 13, 0, 0}, {8, 12, 0, 0}, 4, 4, {text12}
},
{
- {0,0,0,-2,0,-2,-4,0,-3,0,0,-2,-1,-1,0,0,0,0,0,5,2,2,5,0,0,0},
- 2, 1, {13,12,0,0}, {11,11,0,0}, 2, 1, text13
+ {0, 0, 0, -2, 0, -2, -4, 0, -3, 0, 0, -2, -1, -1, 0, 0, 0, 0,
+ 0, 5, 2, 2, 5, 0, 0, 0},
+ 2, 1, {13, 12, 0, 0}, {11, 11, 0, 0}, 2, 1, {text13}
},
{
- {0,0,0,-2,0,-2,-4,0,-3,0,0,-4,0,0,0,0,0,0,0,5,2,2,3,1,1,0},
- 2, 5, {8,11,0,0}, {6,6,0,0}, 6, 3, text14
+ {0, 0, 0, -2, 0, -2, -4, 0, -3, 0, 0, -4, 0, 0, 0, 0, 0, 0,
+ 0, 5, 2, 2, 3, 1, 1, 0},
+ 2, 5, {8, 11, 0, 0}, {6, 6, 0, 0}, 6, 3, {text14}
},
{
- {0,0,0,-2,0,-2,-6,0,-2,0,0,-3,0,0,0,0,0,0,0,4,2,2,2,1,1,0},
- 4, 3, {11,11,0,0}, {7,8,0,0}, 2, 5, text15
+ {0, 0, 0, -2, 0, -2, -6, 0, -2, 0, 0, -3, 0, 0, 0, 0, 0, 0,
+ 0, 4, 2, 2, 2, 1, 1, 0},
+ 4, 3, {11, 11, 0, 0}, {7, 8, 0, 0}, 2, 5, {text15}
},
{
- {0,0,0,-2,0,-2,-6,-1,-3,0,0,-1,0,0,0,0,0,0,0,4,1,2,2,0,1,0},
- 2, 6, {8,11,0,0}, {6,5,0,0}, 6, 1, text16
+ {0, 0, 0, -2, 0, -2, -6, -1, -3, 0, 0, -1, 0, 0, 0, 0, 0, 0,
+ 0, 4, 1, 2, 2, 0, 1, 0},
+ 2, 6, {8, 11, 0, 0}, {6, 5, 0, 0}, 6, 1, {text16}
},
{
- {0,0,0,-2,0,-3,-7,-1,-2,0,0,0,0,0,0,0,0,0,0,3,1,2,2,0,0,0},
- 5, 3, {8,7,0,0}, {3,4,0,0}, 5, 2, text17
+ {0, 0, 0, -2, 0, -3, -7, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 1, 2, 2, 0, 0, 0},
+ 5, 3, {8, 7, 0, 0}, {3, 4, 0, 0}, 5, 2, {text17}
},
{
- {0,0,0,-3,-1,-3,-7,0,-1,0,0,0,0,0,0,0,0,0,0,3,0,1,2,1,0,0},
- 3, 3, {8,3,3,3}, {5,0,0,0}, 1, 6, text18
+ {0, 0, 0, -3, -1, -3, -7, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0,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