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