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

unix.superglobalmegacorp.com

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