121208Sdist /*
2*60748Sbostic  * Copyright (c) 1980, 1993
3*60748Sbostic  *	The Regents of the University of California.  All rights reserved.
433485Sbostic  *
542567Sbostic  * %sccs.include.redist.c%
621208Sdist  */
76755Srrh 
821208Sdist #ifndef lint
9*60748Sbostic static char sccsid[] = "@(#)data.c	8.1 (Berkeley) 05/31/93";
1033485Sbostic #endif /* not lint */
1121208Sdist 
126755Srrh #include "tutor.h"
136755Srrh 
146755Srrh int	maxmoves = 23;
156755Srrh 
166755Srrh char  *text0[] = {
176755Srrh 	"To start the game, I roll a 3, and you roll a 1.  This means",
186755Srrh 	"that I get to start first.  I move 8-5,6-5 since this makes a",
196755Srrh 	"new point and helps to trap your back men on 1.  You should be",
206755Srrh 	"able to do a similar move with your roll.",
216755Srrh 	0
226755Srrh };
236755Srrh 
246755Srrh char  *text1[] = {
256755Srrh 	"Now you shall see a move using doubles.  I just rolled double",
266755Srrh 	"5's.  I will move two men from position 13 to position 3.  The",
276755Srrh 	"notation for this is 13-8,13-8,8-3,8-3.  You will also roll dou-",
286755Srrh 	"bles, but you will be able to make a much stronger move.",
296755Srrh 	0
306755Srrh };
316755Srrh 
326755Srrh char  *text2[] = {
336755Srrh 	"Excellent!  As you can see, you are beginning to develop a wall",
346755Srrh 	"which is trapping my men on position 24.  Also, moving your back",
356755Srrh 	"men forward not only improves your board position safely, but it",
366755Srrh 	"thwarts my effort to make a wall.",
376755Srrh 	"",
386755Srrh 	"My roll now is 5 6.  Normally, I would use that roll to move from",
396755Srrh 	"position 24 to position 13 (24-18-13), but your new point prevents",
406755Srrh 	"that.  Instead, I am forced to move from 13 to 2, where my man is",
416755Srrh 	"open but cannot be hit.",
426755Srrh 	0
436755Srrh };
446755Srrh 
456755Srrh char  *text3[] = {
466755Srrh 	"As you can see, although you left a man open, it is a rela-",
476755Srrh 	"tively safe move to an advantageous position, which might help",
486755Srrh 	"you make a point later.  Only two rolls (4 5 or 5 4) will allow",
496755Srrh 	"me to hit you.  With an unprecedented amount of luck, I happen",
506755Srrh 	"to roll a 4 5 and hit you as just mentioned.",
516755Srrh 	0
526755Srrh };
536755Srrh 
546755Srrh char  *text4[] = {
556755Srrh 	"You're pretty lucky yourself, you know.  I follow by rolling 2 3",
566755Srrh 	"and moving 25-22,24-22, forming a new point.",
576755Srrh 	0
586755Srrh };
596755Srrh 
606755Srrh char  *text5[] = {
616755Srrh 	"Not a spectacular move, but a safe one.  I follow by rolling 6 1.",
626755Srrh 	"I decide to use this roll to move 22-16,16-17.  It leaves me with",
636755Srrh 	"one man still open, but the blot is farther back on the board, and",
646755Srrh 	"would suffer less of a loss by being hit.",
656755Srrh 	0
666755Srrh };
676755Srrh 
686755Srrh char  *text6[] = {
696755Srrh 	"By moving your two men from 17 to 20, you lessen my chance of",
706755Srrh 	"getting my man off the board.  In fact, the odds are 5 to 4",
716755Srrh 	"against me getting off.  I roll with the odds and helplessly",
726755Srrh 	"receive a 3 5.",
736755Srrh 	0
746755Srrh };
756755Srrh 
766755Srrh char  *text7[] = {
776755Srrh 	"Note that the blot on 7 cannot be hit unless I get off the bar",
786755Srrh 	"and have a 1 or a 6 left over, and doing so will leave two of",
796755Srrh 	"my men open.  Also, the blot on 16 cannot be hit at all!  With",
806755Srrh 	"a sigh of frustration, I roll double 6's and remain immobile.",
816755Srrh 	0
826755Srrh };
836755Srrh 
846755Srrh char  *text8[] = {
856755Srrh 	"See, you did not get hit and, you got to 'cover up' your open men.",
866755Srrh 	"Quite an accomplishment.  Finally, I get off the bar by rolling",
876755Srrh 	"6 2 and moving 25-23,23-17.",
886755Srrh 	0
896755Srrh };
906755Srrh 
916755Srrh char  *text9[] = {
926755Srrh 	"My venture off the bar did not last long.  However, I got lucky",
936755Srrh 	"and rolled double 1's, allowing me to move 0-1,1-2,15-14,15-14.",
946755Srrh 	0
956755Srrh };
966755Srrh 
976755Srrh char  *text10[] = {
986755Srrh 	"You are improving your position greatly and safely, and are well",
996755Srrh 	"on the way to winning the game.  I roll a 6 2 and squeak past",
1006755Srrh 	"your back man.  Now the game becomes a race to the finish.",
1016755Srrh 	0
1026755Srrh };
1036755Srrh 
1046755Srrh char  *text11[] = {
1056755Srrh 	"Now that it is merely a race, you are trying to get as many men",
1066755Srrh 	"as possible into the inner table, so you can start removing them.",
1076755Srrh 	"I roll a 3 4 and move my two men farthest back to position 11",
1086755Srrh 	"(15-11,14-11).",
1096755Srrh 	0
1106755Srrh };
1116755Srrh 
1126755Srrh char  *text12[] = {
1136755Srrh 	"The race is still on, and you have seem to be doing all right.",
1146755Srrh 	"I roll 6 1 and move 14-8,13-12.",
1156755Srrh 	0
1166755Srrh };
1176755Srrh 
1186755Srrh char  *text13[] = {
1196755Srrh 	"Notice that you get to remove men the instant you have all of",
1206755Srrh 	"them at your inner table, even if it is the middle of a turn.",
1216755Srrh 	"I roll 1 2 and move 13-11,12-11.",
1226755Srrh 	0
1236755Srrh };
1246755Srrh 
1256755Srrh char  *text14[] = {
1266755Srrh 	"Although you could have removed a man, this move illustrates two",
1276755Srrh 	"points:  1) You never have to remove men, and 2) You should try",
1286755Srrh 	"to spread out your men on your inner table.  Since you have one",
1296755Srrh 	"man on each position, you should be able to remove at least two",
1306755Srrh 	"men next turn.  I roll 2 5 and move 8-6,11-6.",
1316755Srrh 	0
1326755Srrh };
1336755Srrh 
1346755Srrh char  *text15[] = {
1356755Srrh 	"This time you were able to remove men.  I roll 3 4 and move",
1366755Srrh 	"11-7,11-8.  The race continues.",
1376755Srrh 	0
1386755Srrh };
1396755Srrh 
1406755Srrh char  *text16[] = {
1416755Srrh 	"More holes are opening up in your inner table, but you are",
1426755Srrh 	"still very much ahead.  If we were doubling, you would have",
1436755Srrh 	"doubled long ago.  I roll 2 6 and move 8-6,11-5.",
1446755Srrh 	0
1456755Srrh };
1466755Srrh 
1476755Srrh char  *text17[] = {
1486755Srrh 	"It pays to spread out your men.  I roll 3 5 and move 7-4,8-3.",
1496755Srrh 	0
1506755Srrh };
1516755Srrh 
1526755Srrh char  *text18[] = {
1536755Srrh 	"You can only remove some men, but you spread out more and",
1546755Srrh 	"more, in order to be able to remove men more efficiently.",
1556755Srrh 	"I roll double 3's, which help, but not that much.  I move",
1566755Srrh 	"8-5,3-0,3-0,3-0.",
1576755Srrh 	0
1586755Srrh };
1596755Srrh 
1606755Srrh char  *text19[] = {
1616755Srrh 	"I roll 1 4 and move 5-4,4-0.",
1626755Srrh 	0
1636755Srrh };
1646755Srrh 
1656755Srrh char  *text20[] = {
1666755Srrh 	"You are now nicely spread out to win a game.  I roll 5 6 and",
1676755Srrh 	"move 5-0,6-0.",
1686755Srrh 	0
1696755Srrh };
1706755Srrh 
1716755Srrh char  *text21[] = {
1726755Srrh 	"Any minute now.  Just a few short steps from victory.  I roll",
1736755Srrh 	"2 4 and move 6-4,4-0.",
1746755Srrh 	0
1756755Srrh };
1766755Srrh 
1776755Srrh char  *text22[] = {
1786755Srrh 	"It looks pretty hopeless for me, but I play on, rolling 1 3 and",
1796755Srrh 	"moving 4-3,3-0.",
1806755Srrh 	0
1816755Srrh };
1826755Srrh 
1836755Srrh char  *text23[] = {
1846755Srrh 	"Congratulations!  You just won a game of backgammon against the",
1856755Srrh 	"computer!  You will now be able to play a game, but remember,",
1866755Srrh 	"when you start playing, that doubling will be enabled, which",
1876755Srrh 	"will add another factor to the game...  Good luck!!",
1886755Srrh 	"",
1896755Srrh 	0
1906755Srrh };
1916755Srrh 
1926755Srrh struct situatn  test[] = {
1936755Srrh 	{
1946755Srrh 		{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},
19533485Sbostic 		3, 1, {8,6,0,0}, {5,5,0,0}, 4, 2, text0
1966755Srrh 	},
1976755Srrh 	{
1986755Srrh 		{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},
19933485Sbostic 		5, 5, {13,13,8,8}, {8,8,3,3}, 6, 6, text1
2006755Srrh 	},
2016755Srrh 	{
2026755Srrh 		{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},
20333485Sbostic 		6, 5, {13,8,0,0}, {8,2,0,0}, 1, 2, text2
2046755Srrh 	},
2056755Srrh 	{
2066755Srrh 		{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},
20733485Sbostic 		4, 5, {24,20,0,0}, {20,15,0,0}, 2, 5, text3
2086755Srrh 	},
2096755Srrh 	{
2106755Srrh 		{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},
21133485Sbostic 		2, 3, {25,24,0,0}, {22,22,0,0}, 4, 1, text4
2126755Srrh 	},
2136755Srrh 	{
2146755Srrh 		{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},
21533485Sbostic 		6, 1, {22,16,0,0}, {16,15,0,0}, 3, 3, text5
2166755Srrh 	},
2176755Srrh 	{
2186755Srrh 		{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},
21933485Sbostic 		3, 5, {0,0,0,0}, {0,0,0,0}, 5, 4, text6
2206755Srrh 	},
2216755Srrh 	{
2226755Srrh 		{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},
22333485Sbostic 		6, 6, {0,0,0,0}, {0,0,0,0}, 3, 6, text7
2246755Srrh 	},
2256755Srrh 	{
2266755Srrh 		{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},
22733485Sbostic 		2, 6, {25,23,0,0}, {23,17,0,0}, 5, 1, text8
2286755Srrh 	},
2296755Srrh 	{
2306755Srrh 		{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},
23133485Sbostic 		1, 1, {25,24,15,15}, {24,23,14,14}, 4, 6, text9
2326755Srrh 	},
2336755Srrh 	{
2346755Srrh 		{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},
23533485Sbostic 		6, 2, {23,17,0,0}, {17,15,0,0}, 1, 3, text10
2366755Srrh 	},
2376755Srrh 	{
2386755Srrh 		{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},
23933485Sbostic 		4, 3, {15,14,0,0}, {11,11,0,0}, 5, 3, text11
2406755Srrh 	},
2416755Srrh 	{
2426755Srrh 		{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},
24333485Sbostic 		6, 1, {14,13,0,0}, {8,12,0,0}, 4, 4, text12
2446755Srrh 	},
2456755Srrh 	{
2466755Srrh 		{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},
24733485Sbostic 		2, 1, {13,12,0,0}, {11,11,0,0}, 2, 1, text13
2486755Srrh 	},
2496755Srrh 	{
2506755Srrh 		{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},
25133485Sbostic 		2, 5, {8,11,0,0}, {6,6,0,0}, 6, 3, text14
2526755Srrh 	},
2536755Srrh 	{
2546755Srrh 		{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},
25533485Sbostic 		4, 3, {11,11,0,0}, {7,8,0,0}, 2, 5, text15
2566755Srrh 	},
2576755Srrh 	{
2586755Srrh 		{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},
25933485Sbostic 		2, 6, {8,11,0,0}, {6,5,0,0}, 6, 1, text16
2606755Srrh 	},
2616755Srrh 	{
2626755Srrh 		{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},
26333485Sbostic 		5, 3, {8,7,0,0}, {3,4,0,0}, 5, 2, text17
2646755Srrh 	},
2656755Srrh 	{
2666755Srrh 		{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},
26733485Sbostic 		3, 3, {8,3,3,3}, {5,0,0,0}, 1, 6, text18
2686755Srrh 	},
2696755Srrh 	{
2706755Srrh 		{0,0,0,0,-1,-4,-7,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,1,0,0},
27133485Sbostic 		1, 4, {4,5,0,0}, {0,4,0,0}, 2, 3, text19
2726755Srrh 	},
2736755Srrh 	{
2746755Srrh 		{0,0,0,0,-1,-3,-7,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0},
27533485Sbostic 		5, 6, {6,5,0,0}, {0,0,0,0}, 1, 4, text20
2766755Srrh 	},
2776755Srrh 	{
2786755Srrh 		{0,0,0,0,-1,-2,-6,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0},
27933485Sbostic 		2, 4, {4,6,0,0}, {0,4,0,0}, 6, 2, text21
2806755Srrh 	},
2816755Srrh 	{
2826755Srrh 		{0,0,0,0,-1,-2,-5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0},
28333485Sbostic 		3, 1, {4,3,0,0}, {3,0,0,0}, 4, 3, text22
2846755Srrh 	},
2856755Srrh 	{
2866755Srrh 		{0,0,0,0,0,-2,-5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
28733485Sbostic 		0, 0, {0,0,0,0}, {0,0,0,0}, 0, 0, text23
2886755Srrh 	}
2896755Srrh };
290