Annotation of 43BSDTahoe/games/backgammon/data.c, revision 1.1.1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.