1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)data.c	5.1 (Berkeley) 5/29/85";
   9: #endif not lint
  10: 
  11: #include "tutor.h"
  12: 
  13: int maxmoves = 23;
  14: 
  15: char  *text0[] = {
  16:     "To start the game, I roll a 3, and you roll a 1.  This means",
  17:     "that I get to start first.  I move 8-5,6-5 since this makes a",
  18:     "new point and helps to trap your back men on 1.  You should be",
  19:     "able to do a similar move with your roll.",
  20:     0
  21: };
  22: 
  23: char  *text1[] = {
  24:     "Now you shall see a move using doubles.  I just rolled double",
  25:     "5's.  I will move two men from position 13 to position 3.  The",
  26:     "notation for this is 13-8,13-8,8-3,8-3.  You will also roll dou-",
  27:     "bles, but you will be able to make a much stronger move.",
  28:     0
  29: };
  30: 
  31: char  *text2[] = {
  32:     "Excellent!  As you can see, you are beginning to develop a wall",
  33:     "which is trapping my men on position 24.  Also, moving your back",
  34:     "men forward not only improves your board position safely, but it",
  35:     "thwarts my effort to make a wall.",
  36:     "",
  37:     "My roll now is 5 6.  Normally, I would use that roll to move from",
  38:     "position 24 to position 13 (24-18-13), but your new point prevents",
  39:     "that.  Instead, I am forced to move from 13 to 2, where my man is",
  40:     "open but cannot be hit.",
  41:     0
  42: };
  43: 
  44: char  *text3[] = {
  45:     "As you can see, although you left a man open, it is a rela-",
  46:     "tively safe move to an advantageous position, which might help",
  47:     "you make a point later.  Only two rolls (4 5 or 5 4) will allow",
  48:     "me to hit you.  With an unprecedented amount of luck, I happen",
  49:     "to roll a 4 5 and hit you as just mentioned.",
  50:     0
  51: };
  52: 
  53: char  *text4[] = {
  54:     "You're pretty lucky yourself, you know.  I follow by rolling 2 3",
  55:     "and moving 25-22,24-22, forming a new point.",
  56:     0
  57: };
  58: 
  59: char  *text5[] = {
  60:     "Not a spectacular move, but a safe one.  I follow by rolling 6 1.",
  61:     "I decide to use this roll to move 22-16,16-17.  It leaves me with",
  62:     "one man still open, but the blot is farther back on the board, and",
  63:     "would suffer less of a loss by being hit.",
  64:     0
  65: };
  66: 
  67: char  *text6[] = {
  68:     "By moving your two men from 17 to 20, you lessen my chance of",
  69:     "getting my man off the board.  In fact, the odds are 5 to 4",
  70:     "against me getting off.  I roll with the odds and helplessly",
  71:     "receive a 3 5.",
  72:     0
  73: };
  74: 
  75: char  *text7[] = {
  76:     "Note that the blot on 7 cannot be hit unless I get off the bar",
  77:     "and have a 1 or a 6 left over, and doing so will leave two of",
  78:     "my men open.  Also, the blot on 16 cannot be hit at all!  With",
  79:     "a sigh of frustration, I roll double 6's and remain immobile.",
  80:     0
  81: };
  82: 
  83: char  *text8[] = {
  84:     "See, you did not get hit and, you got to 'cover up' your open men.",
  85:     "Quite an accomplishment.  Finally, I get off the bar by rolling",
  86:     "6 2 and moving 25-23,23-17.",
  87:     0
  88: };
  89: 
  90: char  *text9[] = {
  91:     "My venture off the bar did not last long.  However, I got lucky",
  92:     "and rolled double 1's, allowing me to move 0-1,1-2,15-14,15-14.",
  93:     0
  94: };
  95: 
  96: char  *text10[] = {
  97:     "You are improving your position greatly and safely, and are well",
  98:     "on the way to winning the game.  I roll a 6 2 and squeak past",
  99:     "your back man.  Now the game becomes a race to the finish.",
 100:     0
 101: };
 102: 
 103: char  *text11[] = {
 104:     "Now that it is merely a race, you are trying to get as many men",
 105:     "as possible into the inner table, so you can start removing them.",
 106:     "I roll a 3 4 and move my two men farthest back to position 11",
 107:     "(15-11,14-11).",
 108:     0
 109: };
 110: 
 111: char  *text12[] = {
 112:     "The race is still on, and you have seem to be doing all right.",
 113:     "I roll 6 1 and move 14-8,13-12.",
 114:     0
 115: };
 116: 
 117: char  *text13[] = {
 118:     "Notice that you get to remove men the instant you have all of",
 119:     "them at your inner table, even if it is the middle of a turn.",
 120:     "I roll 1 2 and move 13-11,12-11.",
 121:     0
 122: };
 123: 
 124: char  *text14[] = {
 125:     "Although you could have removed a man, this move illustrates two",
 126:     "points:  1) You never have to remove men, and 2) You should try",
 127:     "to spread out your men on your inner table.  Since you have one",
 128:     "man on each position, you should be able to remove at least two",
 129:     "men next turn.  I roll 2 5 and move 8-6,11-6.",
 130:     0
 131: };
 132: 
 133: char  *text15[] = {
 134:     "This time you were able to remove men.  I roll 3 4 and move",
 135:     "11-7,11-8.  The race continues.",
 136:     0
 137: };
 138: 
 139: char  *text16[] = {
 140:     "More holes are opening up in your inner table, but you are",
 141:     "still very much ahead.  If we were doubling, you would have",
 142:     "doubled long ago.  I roll 2 6 and move 8-6,11-5.",
 143:     0
 144: };
 145: 
 146: char  *text17[] = {
 147:     "It pays to spread out your men.  I roll 3 5 and move 7-4,8-3.",
 148:     0
 149: };
 150: 
 151: char  *text18[] = {
 152:     "You can only remove some men, but you spread out more and",
 153:     "more, in order to be able to remove men more efficiently.",
 154:     "I roll double 3's, which help, but not that much.  I move",
 155:     "8-5,3-0,3-0,3-0.",
 156:     0
 157: };
 158: 
 159: char  *text19[] = {
 160:     "I roll 1 4 and move 5-4,4-0.",
 161:     0
 162: };
 163: 
 164: char  *text20[] = {
 165:     "You are now nicely spread out to win a game.  I roll 5 6 and",
 166:     "move 5-0,6-0.",
 167:     0
 168: };
 169: 
 170: char  *text21[] = {
 171:     "Any minute now.  Just a few short steps from victory.  I roll",
 172:     "2 4 and move 6-4,4-0.",
 173:     0
 174: };
 175: 
 176: char  *text22[] = {
 177:     "It looks pretty hopeless for me, but I play on, rolling 1 3 and",
 178:     "moving 4-3,3-0.",
 179:     0
 180: };
 181: 
 182: char  *text23[] = {
 183:     "Congratulations!  You just won a game of backgammon against the",
 184:     "computer!  You will now be able to play a game, but remember,",
 185:     "when you start playing, that doubling will be enabled, which",
 186:     "will add another factor to the game...  Good luck!!",
 187:     "",
 188:     0
 189: };
 190: 
 191: struct situatn  test[] = {
 192:     {
 193:         {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},
 194:         3, 1, {8,6,0,0}, {5,5,0,0}, 4, 2, &text0
 195:     },
 196:     {
 197:         {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},
 198:         5, 5, {13,13,8,8}, {8,8,3,3}, 6, 6, &text1
 199:     },
 200:     {
 201:         {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},
 202:         6, 5, {13,8,0,0}, {8,2,0,0}, 1, 2, &text2
 203:     },
 204:     {
 205:         {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},
 206:         4, 5, {24,20,0,0}, {20,15,0,0}, 2, 5, &text3
 207:     },
 208:     {
 209:         {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},
 210:         2, 3, {25,24,0,0}, {22,22,0,0}, 4, 1, &text4
 211:     },
 212:     {
 213:         {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},
 214:         6, 1, {22,16,0,0}, {16,15,0,0}, 3, 3, &text5
 215:     },
 216:     {
 217:         {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},
 218:         3, 5, {0,0,0,0}, {0,0,0,0}, 5, 4, &text6
 219:     },
 220:     {
 221:         {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},
 222:         6, 6, {0,0,0,0}, {0,0,0,0}, 3, 6, &text7
 223:     },
 224:     {
 225:         {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},
 226:         2, 6, {25,23,0,0}, {23,17,0,0}, 5, 1, &text8
 227:     },
 228:     {
 229:         {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},
 230:         1, 1, {25,24,15,15}, {24,23,14,14}, 4, 6, &text9
 231:     },
 232:     {
 233:         {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},
 234:         6, 2, {23,17,0,0}, {17,15,0,0}, 1, 3, &text10
 235:     },
 236:     {
 237:         {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},
 238:         4, 3, {15,14,0,0}, {11,11,0,0}, 5, 3, &text11
 239:     },
 240:     {
 241:         {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},
 242:         6, 1, {14,13,0,0}, {8,12,0,0}, 4, 4, &text12
 243:     },
 244:     {
 245:         {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},
 246:         2, 1, {13,12,0,0}, {11,11,0,0}, 2, 1, &text13
 247:     },
 248:     {
 249:         {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},
 250:         2, 5, {8,11,0,0}, {6,6,0,0}, 6, 3, &text14
 251:     },
 252:     {
 253:         {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},
 254:         4, 3, {11,11,0,0}, {7,8,0,0}, 2, 5, &text15
 255:     },
 256:     {
 257:         {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},
 258:         2, 6, {8,11,0,0}, {6,5,0,0}, 6, 1, &text16
 259:     },
 260:     {
 261:         {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},
 262:         5, 3, {8,7,0,0}, {3,4,0,0}, 5, 2, &text17
 263:     },
 264:     {
 265:         {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},
 266:         3, 3, {8,3,3,3}, {5,0,0,0}, 1, 6, &text18
 267:     },
 268:     {
 269:         {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},
 270:         1, 4, {4,5,0,0}, {0,4,0,0}, 2, 3, &text19
 271:     },
 272:     {
 273:         {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},
 274:         5, 6, {6,5,0,0}, {0,0,0,0}, 1, 4, &text20
 275:     },
 276:     {
 277:         {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},
 278:         2, 4, {4,6,0,0}, {0,4,0,0}, 6, 2, &text21
 279:     },
 280:     {
 281:         {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},
 282:         3, 1, {4,3,0,0}, {3,0,0,0}, 4, 3, &text22
 283:     },
 284:     {
 285:         {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},
 286:         0, 0, {0,0,0,0}, {0,0,0,0}, 0, 0, &text23
 287:     }
 288: };

Defined variables

maxmoves defined in line 13; used 1 times
sccsid defined in line 8; never used
test defined in line 191; used 10 times
text0 defined in line 15; used 1 times
text1 defined in line 23; used 1 times
text10 defined in line 96; used 1 times
text11 defined in line 103; used 1 times
text12 defined in line 111; used 1 times
text13 defined in line 117; used 1 times
text14 defined in line 124; used 1 times
text15 defined in line 133; used 1 times
text16 defined in line 139; used 1 times
text17 defined in line 146; used 1 times
text18 defined in line 151; used 1 times
text19 defined in line 159; used 1 times
text2 defined in line 31; used 1 times
text20 defined in line 164; used 1 times
text21 defined in line 170; used 1 times
text22 defined in line 176; used 1 times
text23 defined in line 182; used 1 times
text3 defined in line 44; used 1 times
text4 defined in line 53; used 1 times
text5 defined in line 59; used 1 times
text6 defined in line 67; used 1 times
text7 defined in line 75; used 1 times
text8 defined in line 83; used 1 times
text9 defined in line 90; used 1 times
Last modified: 1985-05-29
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1670
Valid CSS Valid XHTML 1.0 Strict