121208Sdist /* 221208Sdist * Copyright (c) 1980 Regents of the University of California. 3*33485Sbostic * All rights reserved. 4*33485Sbostic * 5*33485Sbostic * Redistribution and use in source and binary forms are permitted 6*33485Sbostic * provided that this notice is preserved and that due credit is given 7*33485Sbostic * to the University of California at Berkeley. The name of the University 8*33485Sbostic * may not be used to endorse or promote products derived from this 9*33485Sbostic * software without specific prior written permission. This software 10*33485Sbostic * is provided ``as is'' without express or implied warranty. 1121208Sdist */ 126755Srrh 1321208Sdist #ifndef lint 14*33485Sbostic static char sccsid[] = "@(#)data.c 5.2 (Berkeley) 02/16/88"; 15*33485Sbostic #endif /* not lint */ 1621208Sdist 176755Srrh #include "tutor.h" 186755Srrh 196755Srrh int maxmoves = 23; 206755Srrh 216755Srrh char *text0[] = { 226755Srrh "To start the game, I roll a 3, and you roll a 1. This means", 236755Srrh "that I get to start first. I move 8-5,6-5 since this makes a", 246755Srrh "new point and helps to trap your back men on 1. You should be", 256755Srrh "able to do a similar move with your roll.", 266755Srrh 0 276755Srrh }; 286755Srrh 296755Srrh char *text1[] = { 306755Srrh "Now you shall see a move using doubles. I just rolled double", 316755Srrh "5's. I will move two men from position 13 to position 3. The", 326755Srrh "notation for this is 13-8,13-8,8-3,8-3. You will also roll dou-", 336755Srrh "bles, but you will be able to make a much stronger move.", 346755Srrh 0 356755Srrh }; 366755Srrh 376755Srrh char *text2[] = { 386755Srrh "Excellent! As you can see, you are beginning to develop a wall", 396755Srrh "which is trapping my men on position 24. Also, moving your back", 406755Srrh "men forward not only improves your board position safely, but it", 416755Srrh "thwarts my effort to make a wall.", 426755Srrh "", 436755Srrh "My roll now is 5 6. Normally, I would use that roll to move from", 446755Srrh "position 24 to position 13 (24-18-13), but your new point prevents", 456755Srrh "that. Instead, I am forced to move from 13 to 2, where my man is", 466755Srrh "open but cannot be hit.", 476755Srrh 0 486755Srrh }; 496755Srrh 506755Srrh char *text3[] = { 516755Srrh "As you can see, although you left a man open, it is a rela-", 526755Srrh "tively safe move to an advantageous position, which might help", 536755Srrh "you make a point later. Only two rolls (4 5 or 5 4) will allow", 546755Srrh "me to hit you. With an unprecedented amount of luck, I happen", 556755Srrh "to roll a 4 5 and hit you as just mentioned.", 566755Srrh 0 576755Srrh }; 586755Srrh 596755Srrh char *text4[] = { 606755Srrh "You're pretty lucky yourself, you know. I follow by rolling 2 3", 616755Srrh "and moving 25-22,24-22, forming a new point.", 626755Srrh 0 636755Srrh }; 646755Srrh 656755Srrh char *text5[] = { 666755Srrh "Not a spectacular move, but a safe one. I follow by rolling 6 1.", 676755Srrh "I decide to use this roll to move 22-16,16-17. It leaves me with", 686755Srrh "one man still open, but the blot is farther back on the board, and", 696755Srrh "would suffer less of a loss by being hit.", 706755Srrh 0 716755Srrh }; 726755Srrh 736755Srrh char *text6[] = { 746755Srrh "By moving your two men from 17 to 20, you lessen my chance of", 756755Srrh "getting my man off the board. In fact, the odds are 5 to 4", 766755Srrh "against me getting off. I roll with the odds and helplessly", 776755Srrh "receive a 3 5.", 786755Srrh 0 796755Srrh }; 806755Srrh 816755Srrh char *text7[] = { 826755Srrh "Note that the blot on 7 cannot be hit unless I get off the bar", 836755Srrh "and have a 1 or a 6 left over, and doing so will leave two of", 846755Srrh "my men open. Also, the blot on 16 cannot be hit at all! With", 856755Srrh "a sigh of frustration, I roll double 6's and remain immobile.", 866755Srrh 0 876755Srrh }; 886755Srrh 896755Srrh char *text8[] = { 906755Srrh "See, you did not get hit and, you got to 'cover up' your open men.", 916755Srrh "Quite an accomplishment. Finally, I get off the bar by rolling", 926755Srrh "6 2 and moving 25-23,23-17.", 936755Srrh 0 946755Srrh }; 956755Srrh 966755Srrh char *text9[] = { 976755Srrh "My venture off the bar did not last long. However, I got lucky", 986755Srrh "and rolled double 1's, allowing me to move 0-1,1-2,15-14,15-14.", 996755Srrh 0 1006755Srrh }; 1016755Srrh 1026755Srrh char *text10[] = { 1036755Srrh "You are improving your position greatly and safely, and are well", 1046755Srrh "on the way to winning the game. I roll a 6 2 and squeak past", 1056755Srrh "your back man. Now the game becomes a race to the finish.", 1066755Srrh 0 1076755Srrh }; 1086755Srrh 1096755Srrh char *text11[] = { 1106755Srrh "Now that it is merely a race, you are trying to get as many men", 1116755Srrh "as possible into the inner table, so you can start removing them.", 1126755Srrh "I roll a 3 4 and move my two men farthest back to position 11", 1136755Srrh "(15-11,14-11).", 1146755Srrh 0 1156755Srrh }; 1166755Srrh 1176755Srrh char *text12[] = { 1186755Srrh "The race is still on, and you have seem to be doing all right.", 1196755Srrh "I roll 6 1 and move 14-8,13-12.", 1206755Srrh 0 1216755Srrh }; 1226755Srrh 1236755Srrh char *text13[] = { 1246755Srrh "Notice that you get to remove men the instant you have all of", 1256755Srrh "them at your inner table, even if it is the middle of a turn.", 1266755Srrh "I roll 1 2 and move 13-11,12-11.", 1276755Srrh 0 1286755Srrh }; 1296755Srrh 1306755Srrh char *text14[] = { 1316755Srrh "Although you could have removed a man, this move illustrates two", 1326755Srrh "points: 1) You never have to remove men, and 2) You should try", 1336755Srrh "to spread out your men on your inner table. Since you have one", 1346755Srrh "man on each position, you should be able to remove at least two", 1356755Srrh "men next turn. I roll 2 5 and move 8-6,11-6.", 1366755Srrh 0 1376755Srrh }; 1386755Srrh 1396755Srrh char *text15[] = { 1406755Srrh "This time you were able to remove men. I roll 3 4 and move", 1416755Srrh "11-7,11-8. The race continues.", 1426755Srrh 0 1436755Srrh }; 1446755Srrh 1456755Srrh char *text16[] = { 1466755Srrh "More holes are opening up in your inner table, but you are", 1476755Srrh "still very much ahead. If we were doubling, you would have", 1486755Srrh "doubled long ago. I roll 2 6 and move 8-6,11-5.", 1496755Srrh 0 1506755Srrh }; 1516755Srrh 1526755Srrh char *text17[] = { 1536755Srrh "It pays to spread out your men. I roll 3 5 and move 7-4,8-3.", 1546755Srrh 0 1556755Srrh }; 1566755Srrh 1576755Srrh char *text18[] = { 1586755Srrh "You can only remove some men, but you spread out more and", 1596755Srrh "more, in order to be able to remove men more efficiently.", 1606755Srrh "I roll double 3's, which help, but not that much. I move", 1616755Srrh "8-5,3-0,3-0,3-0.", 1626755Srrh 0 1636755Srrh }; 1646755Srrh 1656755Srrh char *text19[] = { 1666755Srrh "I roll 1 4 and move 5-4,4-0.", 1676755Srrh 0 1686755Srrh }; 1696755Srrh 1706755Srrh char *text20[] = { 1716755Srrh "You are now nicely spread out to win a game. I roll 5 6 and", 1726755Srrh "move 5-0,6-0.", 1736755Srrh 0 1746755Srrh }; 1756755Srrh 1766755Srrh char *text21[] = { 1776755Srrh "Any minute now. Just a few short steps from victory. I roll", 1786755Srrh "2 4 and move 6-4,4-0.", 1796755Srrh 0 1806755Srrh }; 1816755Srrh 1826755Srrh char *text22[] = { 1836755Srrh "It looks pretty hopeless for me, but I play on, rolling 1 3 and", 1846755Srrh "moving 4-3,3-0.", 1856755Srrh 0 1866755Srrh }; 1876755Srrh 1886755Srrh char *text23[] = { 1896755Srrh "Congratulations! You just won a game of backgammon against the", 1906755Srrh "computer! You will now be able to play a game, but remember,", 1916755Srrh "when you start playing, that doubling will be enabled, which", 1926755Srrh "will add another factor to the game... Good luck!!", 1936755Srrh "", 1946755Srrh 0 1956755Srrh }; 1966755Srrh 1976755Srrh struct situatn test[] = { 1986755Srrh { 1996755Srrh {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}, 200*33485Sbostic 3, 1, {8,6,0,0}, {5,5,0,0}, 4, 2, text0 2016755Srrh }, 2026755Srrh { 2036755Srrh {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}, 204*33485Sbostic 5, 5, {13,13,8,8}, {8,8,3,3}, 6, 6, text1 2056755Srrh }, 2066755Srrh { 2076755Srrh {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}, 208*33485Sbostic 6, 5, {13,8,0,0}, {8,2,0,0}, 1, 2, text2 2096755Srrh }, 2106755Srrh { 2116755Srrh {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}, 212*33485Sbostic 4, 5, {24,20,0,0}, {20,15,0,0}, 2, 5, text3 2136755Srrh }, 2146755Srrh { 2156755Srrh {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}, 216*33485Sbostic 2, 3, {25,24,0,0}, {22,22,0,0}, 4, 1, text4 2176755Srrh }, 2186755Srrh { 2196755Srrh {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}, 220*33485Sbostic 6, 1, {22,16,0,0}, {16,15,0,0}, 3, 3, text5 2216755Srrh }, 2226755Srrh { 2236755Srrh {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}, 224*33485Sbostic 3, 5, {0,0,0,0}, {0,0,0,0}, 5, 4, text6 2256755Srrh }, 2266755Srrh { 2276755Srrh {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}, 228*33485Sbostic 6, 6, {0,0,0,0}, {0,0,0,0}, 3, 6, text7 2296755Srrh }, 2306755Srrh { 2316755Srrh {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}, 232*33485Sbostic 2, 6, {25,23,0,0}, {23,17,0,0}, 5, 1, text8 2336755Srrh }, 2346755Srrh { 2356755Srrh {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}, 236*33485Sbostic 1, 1, {25,24,15,15}, {24,23,14,14}, 4, 6, text9 2376755Srrh }, 2386755Srrh { 2396755Srrh {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}, 240*33485Sbostic 6, 2, {23,17,0,0}, {17,15,0,0}, 1, 3, text10 2416755Srrh }, 2426755Srrh { 2436755Srrh {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}, 244*33485Sbostic 4, 3, {15,14,0,0}, {11,11,0,0}, 5, 3, text11 2456755Srrh }, 2466755Srrh { 2476755Srrh {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}, 248*33485Sbostic 6, 1, {14,13,0,0}, {8,12,0,0}, 4, 4, text12 2496755Srrh }, 2506755Srrh { 2516755Srrh {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}, 252*33485Sbostic 2, 1, {13,12,0,0}, {11,11,0,0}, 2, 1, text13 2536755Srrh }, 2546755Srrh { 2556755Srrh {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}, 256*33485Sbostic 2, 5, {8,11,0,0}, {6,6,0,0}, 6, 3, text14 2576755Srrh }, 2586755Srrh { 2596755Srrh {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}, 260*33485Sbostic 4, 3, {11,11,0,0}, {7,8,0,0}, 2, 5, text15 2616755Srrh }, 2626755Srrh { 2636755Srrh {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}, 264*33485Sbostic 2, 6, {8,11,0,0}, {6,5,0,0}, 6, 1, text16 2656755Srrh }, 2666755Srrh { 2676755Srrh {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}, 268*33485Sbostic 5, 3, {8,7,0,0}, {3,4,0,0}, 5, 2, text17 2696755Srrh }, 2706755Srrh { 2716755Srrh {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}, 272*33485Sbostic 3, 3, {8,3,3,3}, {5,0,0,0}, 1, 6, text18 2736755Srrh }, 2746755Srrh { 2756755Srrh {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}, 276*33485Sbostic 1, 4, {4,5,0,0}, {0,4,0,0}, 2, 3, text19 2776755Srrh }, 2786755Srrh { 2796755Srrh {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}, 280*33485Sbostic 5, 6, {6,5,0,0}, {0,0,0,0}, 1, 4, text20 2816755Srrh }, 2826755Srrh { 2836755Srrh {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}, 284*33485Sbostic 2, 4, {4,6,0,0}, {0,4,0,0}, 6, 2, text21 2856755Srrh }, 2866755Srrh { 2876755Srrh {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}, 288*33485Sbostic 3, 1, {4,3,0,0}, {3,0,0,0}, 4, 3, text22 2896755Srrh }, 2906755Srrh { 2916755Srrh {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}, 292*33485Sbostic 0, 0, {0,0,0,0}, {0,0,0,0}, 0, 0, text23 2936755Srrh } 2946755Srrh }; 295