Annotation of 42BSD/games/backgammon/ttext1.c, revision 1.1.1.1

1.1       root        1: static char sccsid[] = "       ttext1.c        4.1     82/05/11        ";
                      2: 
                      3: #include "back.h"
                      4: 
                      5: char   *opts = " QIMRHEDSPT";
                      6: char   *prompt = "-->";
                      7: 
                      8: char *list[] = {
                      9:     "\n\n\tI\tIntroduction to Backgammon",
                     10:     "\tM\tMoves and Points",
                     11:     "\tR\tRemoving Men from the Board",
                     12:     "\tH\tHitting Blots",
                     13:     "\tE\tEnding the Game and Scoring",
                     14:     "\tD\tDoubling",
                     15:     "\tS\tStrategy",
                     16:     "\tP\tThe Program and How to Use It",
                     17:     "\nalso, you can type:",
                     18:     "\t?\tto get this list",
                     19:     "\tQ\tto go start playing",
                     20:     "\tT\tto go straight to the tutorial",
                     21:     0
                     22: };
                     23: 
                     24: char   *hello[] = {
                     25:     "\n\032   These rules consist of text describing how to play Backgammon",
                     26:     "followed by a tutorial session where you play a practice game",
                     27:     "against the computer.  When using this program, think carefuly",
                     28:     "before typing, since it reacts as soon as you type something.  In",
                     29:     "addition, the program presents text output, such as these rules,",
                     30:     "in small blocks that will not roll off the top of the screen.",
                     31:     "Frequently, you will see the characters '-->' indicating that the",
                     32:     "program is waiting for you to finish reading, and will continue",
                     33:     "printing when you type a space or newline.  Also, the rules are",
                     34:     "divided into sections, and although you should read them in or-",
                     35:     "der, you can go directly to any of them by typing one of the fol-",
                     36:     "lowing letters:",
                     37:     "(Remember to hit a space or a newline to continue.)",
                     38:     "",
                     39:     0
                     40: };
                     41: 
                     42: char   *intro1[] = {
                     43:     "\nIntroduction:",
                     44:     "\n   Backgammon is a game involving the skill of two players and",
                     45:     "the luck of two dice.  There are two players, red and white, and",
                     46:     "each player gets fifteen men.  The object of the game is to re-",
                     47:     "move all your men from the board before the opponent does.  The",
                     48:     "board consists of twenty-four positions, a 'bar' and a 'home' for",
                     49:     "each player.  It looks like this:",
                     50:     "",
                     51:     0};
                     52: 
                     53: char   *intro2[] = {
                     54:     "",
                     55:     "\n   Although not indicated on the board, the players' homes are",
                     56:     "located just to the right of the board.  A player's men are placed",
                     57:     "there when they are removed from the board.  The board you just",
                     58:     "saw was in it's initial position.  All games start with the board",
                     59:     "looking like this.  Notice that red's pieces are represented by the",
                     60:     "letter 'r' and white's pieces are represented by the letter 'w'.",
                     61:     "Also, a position may have zero or more pieces on it, e.g.  posi-",
                     62:     "tion 12 has five red pieces on it, while position 11 does not",
                     63:     "have any pieces of either color.",
                     64:     "",
                     65:     0};
                     66: 
                     67: char   *moves[] = {
                     68:     "\nMoves and Points:",
                     69:     "\n   Moves are made along the positions on the board according to",
                     70:     "their numbers.  Red moves in the positive direction (clockwise",
                     71:     "from 1 to 24), and white moves in the negative direction (coun-",
                     72:     "terclockwise from 24 to 1).",
                     73:     "\n   A turn consists of rolling the dice, and moving the number of",
                     74:     "positions indicated on each die.  The two numbers can be used to",
                     75:     "move one man the sum of the two rolls, or two men the number on",
                     76:     "each individual die.  For example, if red rolled 6 3 at the start",
                     77:     "of the game, he might move a man from 1 to 7 to 10, using both",
                     78:     "dice for one man, or he might move two men from position 12, one",
                     79:     "to 15 and one to 18.  (Red did not have to choose two men start-",
                     80:     "ing from the same position.)  In addition, doubles are treated",
                     81:     "specially in backgammon.  When a player rolls doubles, he gets to",
                     82:     "move as if he had four dice instead of two.  For instance, if you",
                     83:     "rolled double 2's, you could move one man eight positions, four",
                     84:     "men two positions each, or any permutation in between.",
                     85:     "",
                     86:     "\n   However, there are certain limitations, called 'points.'  A",
                     87:     "player has a point when he has two or more men on the same posi-",
                     88:     "tion.  This gives him custody of that position, and his opponent",
                     89:     "cannot place his men there, even if passing through on the way to",
                     90:     "another position.  When a player has six points in a row, it is",
                     91:     "called a 'wall,' since any of his opponent's men behind the wall",
                     92:     "cannot pass it and are trapped, at least for the moment.  Notice",
                     93:     "that this could mean that a player could not use part or all of",
                     94:     "his roll.  However, he must use as much of his roll as possible.",
                     95:     "",
                     96:     0};
                     97: 
                     98: char   *remove[] = {
                     99:     "\nRemoving Men from the Board:",
                    100:     "\n   The most important part of the game is removing men, since",
                    101:     "that is how you win the game.  Once a man is removed, he stays",
                    102:     "off the board for the duration of the game.  However, a player",
                    103:     "cannot remove men until all his men are on his 'inner table,' or",
                    104:     "the last six positions of the board (19-24 for red, 6-1 for",
                    105:     "white).",
                    106:     "\n   To get off the board, a player must roll the exact number to",
                    107:     "get his man one position past the last position on the board, or",
                    108:     "his 'home.'  Hence, if red wanted to remove a man from position",
                    109:     "23, he would have to roll a 2, anything else would be used for",
                    110:     "another man, or for another purpose.  However, there is one ex-",
                    111:     "ception.  If the player rolling has no men far enough to move the",
                    112:     "roll made, he may move his farthest man off the board.  For exam-",
                    113:     "ple, if red's farthest man back was on position 21, he could re-",
                    114:     "move men from that position if he rolled a 5 or a 6, as well as a",
                    115:     "4.  Since he does not have men on 20 (where he could use a 5) or",
                    116:     "on 19 (where he could use a 6), he can use these rolls for posi-",
                    117:     "tion 21.  A player never has to remove men, but he must make as",
                    118:     "many moves as possible.",
                    119:     "",
                    120:     0};
                    121: 
                    122: char   *hits[] = {
                    123:     "\nHitting Blots:",
                    124:     "\n   Although two men on a position form an impenetrable point, a",
                    125:     "lone man is not so secure.  Such a man is called a 'blot' and has",
                    126:     "the potential of getting hit by an opposing man.  When a player's",
                    127:     "blot is hit, he is placed on the bar, and the first thing that",
                    128:     "player must do is move the man off the bar.  Such moves are",
                    129:     "counted as if the bar is one position behind the first position",
                    130:     "on the board.  Thus if red has a man on the bar and rolls 2 3, he",
                    131:     "must move the man on the bar to position 2 or 3 before moving any",
                    132:     "other man.  If white had points on positions 2 and 3, then red",
                    133:     "would forfeit his turn.  Being on the bar is a very bad position,",
                    134:     "for often a player can lose many turns trying to move off the",
                    135:     "bar, as well as being set back the full distance of the board.",
                    136:     "",
                    137:     0};
                    138: 
                    139: char   *endgame[] = {
                    140:     "\nEnding the Game and Scoring:",
                    141:     "\n   Winning a game usually wins one point, the normal value of a",
                    142:     "game.  However, if the losing player has not removed any men yet,",
                    143:     "then the winning player wins double the game value, called a",
                    144:     "'gammon.'  If the losing player has a player on the bar or on the",
                    145:     "winner's inner table, then the winner gets triple the game value,",
                    146:     "which is called a 'backgammon.'  (So that's where the name comes",
                    147:     "from!)",
                    148:     "",
                    149:     0};

unix.superglobalmegacorp.com

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