# To unbundle, run this file echo arithmetic.6 sed 's/.//' >arithmetic.6 <<'//GO.SYSIN DD arithmetic.6' -.TH ARITHMETIC 6 -.SH NAME -arithmetic \- provide drill in number facts -.SH SYNOPSIS -.B /usr/games/arithmetic -[ -.B +\-x/ -] [ range ] -.SH DESCRIPTION -.I Arithmetic -types out simple arithmetic problems, -and waits for an answer to be typed in. -If the answer is correct, -it types back "Right!", -and a new problem. -If the answer is wrong, -it replies "What?", -and waits for another answer. -Every twenty problems, it publishes -statistics on correctness and the time required -to answer. -.PP -To quit the program, -type an interrupt (delete). -.PP -The first optional argument determines the kind of problem -to be generated; -.B +\-x/ -respectively cause -addition, subtraction, multiplication, and division -problems to be generated. -One or more characters can be given; -if more than one is given, the different types of -problems will be mixed in random order; default is -.B +\- -.PP -.I Range -is a decimal number; -all addends, subtrahends, differences, multiplicands, divisors, -and quotients will be less than or equal to the value of -.IR range . -Default -.I range -is 10. -.PP -At the start, all numbers less than or equal to -.I range -are equally likely -to appear. -If the respondent makes a mistake, -the numbers in the problem which was missed -become more likely to reappear. -.PP -As a matter of educational philosophy, the program will -not give correct answers, -since the learner should, in principle, -be able to calculate them. -Thus the program is intended to provide drill for -someone just past the first learning stage, -not to teach number facts -.I de -.IR novo . -For almost all users, -the relevant statistic should be -time per problem, not percent correct. //GO.SYSIN DD arithmetic.6 echo backgammon.6 sed 's/.//' >backgammon.6 <<'//GO.SYSIN DD backgammon.6' -.TH BACKGAMMON 6 -.SH NAME -backgammon \- the game -.SH SYNOPSIS -.B /usr/games/backgammon -.SH DESCRIPTION -This program does what you expect. -It will ask whether you need instructions. //GO.SYSIN DD backgammon.6 echo banner.6 sed 's/.//' >banner.6 <<'//GO.SYSIN DD banner.6' -.TH BANNER 6 -.SH NAME -banner \- make long posters -.SH SYNOPSIS -.B /usr/games/banner -.SH DESCRIPTION -.I Banner -reads the standard input and -prints it sideways in huge built-up letters -on the standard output. //GO.SYSIN DD banner.6 echo bcd.6 sed 's/.//' >bcd.6 <<'//GO.SYSIN DD bcd.6' -.TH BCD 6 -.SH NAME -bcd, ppt \- convert to antique media -.SH SYNOPSIS -.B /usr/games/bcd -text -.PP -.B /usr/games/ppt -.SH DESCRIPTION -.I Bcd -converts the literal -.I text -into a form familiar to old-timers. -.PP -.I Ppt -converts the standard input into yet another form. -.SH "SEE ALSO" -dd(1) //GO.SYSIN DD bcd.6 echo bj.6 sed 's/.//' >bj.6 <<'//GO.SYSIN DD bj.6' -.TH BJ 6 -.SH NAME -bj \- the game of black jack -.SH SYNOPSIS -.B /usr/games/bj -.SH DESCRIPTION -.I Bj -is a serious attempt at -simulating the dealer -in the game of black jack (or twenty-one) -as might be found in Reno. -The following rules apply: -.HP 5 -The bet is $2 every hand. -.IP -A player `natural' (black jack) pays $3. -A dealer natural loses $2. -Both dealer and player naturals -is a `push' (no money exchange). -.IP -If the dealer has an ace up, -the player is allowed to make an `insurance' -bet against the chance of a dealer natural. -If this bet is not taken, play resumes as normal. -If the bet is taken, it is a side bet -where the player wins $2 if the dealer has -a natural and loses $1 if the dealer does not. -.IP -If the player is dealt two cards -of the same value, he is allowed to -`double'. -He is allowed to play two -hands, each with one of these cards. -(The bet is doubled also; $2 on each hand.) -.IP -If a dealt hand -has a total of ten or eleven, -the player may `double down'. -He may double the bet ($2 to $4) -and receive exactly one more card on that hand. -.IP -Under normal play, -the player may `hit' (draw a card) -as long as his total is not over twenty-one. -If the player `busts' (goes over twenty-one), -the dealer wins the bet. -.IP -When the player `stands' (decides not to hit), -the dealer hits until he attains -a total of seventeen or more. -If the dealer busts, the player wins the bet. -.IP -If both player and dealer stand, -the one with the largest total wins. -A tie is a push. -.PP -The machine deals and keeps score. -The following questions will be asked at -appropriate times. -Each question is -answered by -.B y -followed by a new line for `yes', -or just new line for `no'. -.PP -? (means, `do you want a hit?') -.br -Insurance? -.br -Double down? -.PP -Every time the deck is shuffled, -the dealer so states and the `action' (total bet) -and `standing' (total won or lost) -is printed. -To exit, hit the interrupt key (DEL) -and the action and standing will be printed. //GO.SYSIN DD bj.6 echo checkers.6 sed 's/.//' >checkers.6 <<'//GO.SYSIN DD checkers.6' -.TH CHECKERS 6 -.SH NAME -checkers \- game -.SH SYNOPSIS -.B /usr/games/checkers -.SH DESCRIPTION -.I Checkers -uses standard notation for the board: -.PP -.ce -BLACK -.nf -.TS -center, box; -r|r|r|r|r|r|r|r. -//// 1 //// 2 //// 3 //// 4 -//// //// //// //// -_ -5 //// 6 //// 7 //// 8 //// - //// //// //// //// -_ -//// 9 //// 10 //// 11 //// 12 -//// //// //// //// -_ -13 //// 14 //// 15 //// 16 //// - //// //// //// //// -_ -//// 17 //// 18 //// 19 //// 20 -//// //// //// //// -_ -21 //// 22 //// 23 //// 24 //// - //// //// //// //// -_ -//// 25 //// 26 //// 27 //// 28 -//// //// //// //// -_ -29 //// 30 //// 31 //// 32 //// - //// //// //// //// -_ -.TE -.ce -WHITE -.fi -.PP -Black plays first. -The program normally plays white. -To specify a move, name the square moved from -and the square moved to. -For multiple jumps name all the squares touched. -.PP -.PP -Certain commands may be given instead of moves: -.TP \w'reverse\ \ 'u -reverse -Reverse roles; the program takes over your pieces. -.TP -backup -Undo the last move for each player. -.TP -list -Print the record of the game. -.TP -move -Let the program select a move for you. -.TP -print -Print a map of the present position. //GO.SYSIN DD checkers.6 echo chess.6 sed 's/.//' >chess.6 <<'//GO.SYSIN DD chess.6' -.TH CHESS 6 -.SH NAME -chess \- the game of chess -.SH SYNOPSIS -.B /usr/games/chess -.SH DESCRIPTION -.I Chess -is a computer program that plays class D chess. -Moves may be given either in standard (descriptive) notation -or in algebraic notation. -The symbol `+' is used to specify check; -`o-o' and `o-o-o' specify castling. -To play black, type `first'; -to print the board, type an empty line. -.PP -Each move is echoed in the appropriate notation followed by -the program's reply. -.SH FILES -/usr/lib/book opening `book' -.SH DIAGNOSTICS -The most cryptic diagnostic is `eh?' which -means that the input was syntactically incorrect. -.SH WARNING -Over-use of this program -will cause it to go away. -.SH BUGS -Pawns may be promoted only to queens. //GO.SYSIN DD chess.6 echo ching.6 sed 's/.//' >ching.6 <<'//GO.SYSIN DD ching.6' -.TH CHING 6 -.SH NAME -ching, fortune \- the book of changes and other cookies -.SH SYNOPSIS -.B /usr/games/ching -[ hexagram ] -.PP -.B /usr/games/fortune -.SH DESCRIPTION -The -.I "I Ching" -or -.I "Book of Changes" -is an ancient Chinese oracle -that has been in use for -centuries -as a source of wisdom -and advice. -.PP -The text of the -.I oracle -(as it is sometimes known) -consists of sixty-four -.I hexagrams, -each symbolized -by a particular -arrangement of -six straight -(\-\-\-) -and broken -(\-\ \-) -lines. -These lines -have values ranging -from six through nine, -with the even -values indicating -the broken lines. -.PP -Each hexagram -consists of two major sections. -The -.B Judgement -relates specifically -to the matter at hand -(E.g., -"It furthers one to have somewhere to go.") -while the -.B Image -describes -the general attributes -of the hexagram -and how they apply -to one's own life -("Thus the superior man -makes himself strong -and untiring."). -.PP -When any of the lines -have the values six or nine, -they are moving lines; -for each -there is an appended -judgement which -becomes significant. -Furthermore, the moving lines -are inherently unstable and -change into their opposites; -a second hexagram -(and thus an additional judgement) -is formed. -.PP -Normally, one consults the oracle -by fixing the desired question -firmly in mind -and then casting a set of changes -(lines) -using yarrow\-stalks -or tossed coins. -The resulting hexagram -will be the answer -to the question. -.PP -Using an algorithm -suggested by S. C. Johnson, -the Unix -.IR oracle " simply reads" -a question -from the standard input -(up to an EOF) -and hashes the individual -characters -in combination with the -time of day, process id -and any other magic numbers -which happen to be lying -around the system. -The resulting value -is used as the seed -of a random number generator -which drives a simulated -coin\-toss divination. -The answer is then piped through -.BR nroff " for formatting" -and will appear on the -standard output. -.PP -For those who wish -to remain steadfast -in the old traditions, -the oracle will also accept -the results of a personal -divination using, -for example, -coins. -To do this, -cast the change -and then type the -resulting line values -as an argument. -.PP -The impatient modern may prefer to settle for -Chinese cookies; try -.I fortune. -.SH "SEE ALSO" -It furthers one to see the great man. -.SH DIAGNOSTICS -The great prince issues commands, -.br -Founds states, vests families with fiefs. -.br -Inferior people should not be employed. -.SH BUGS -Waiting in the mud -.br -Brings about the arrival of the enemy. -.PP -If one is not extremely careful, -.br -Somebody may come up from behind and strike him. -.br -Misfortune. //GO.SYSIN DD ching.6 echo cubic.6 sed 's/.//' >cubic.6 <<'//GO.SYSIN DD cubic.6' -.so /usr/man/man6/ttt.6 //GO.SYSIN DD cubic.6 echo maze.6 sed 's/.//' >maze.6 <<'//GO.SYSIN DD maze.6' -.TH MAZE 6 -.SH NAME -maze \- generate a maze problem -.SH SYNOPSIS -.B /usr/games/maze/ -.SH DESCRIPTION -.I Maze -asks a few questions and then -prints a maze. -.SH BUGS -Some mazes (especially small ones) -have no solutions. //GO.SYSIN DD maze.6 echo moo.6 sed 's/.//' >moo.6 <<'//GO.SYSIN DD moo.6' -.TH MOO 6 -.SH NAME -moo \- guessing game -.SH SYNOPSIS -.B /usr/games/moo -.SH DESCRIPTION -.I Moo -is a guessing game imported from England. -The computer picks a number consisting -of four distinct decimal digits. -The player guesses four distinct digits -being scored on each guess. -A `cow' is a correct digit in an incorrect position. -A `bull' is a correct digit in a correct position. -The game continues until the player guesses the number -(a score of four bulls). //GO.SYSIN DD moo.6 echo quiz.6 sed 's/.//' >quiz.6 <<'//GO.SYSIN DD quiz.6' -.TH QUIZ 6 -.SH NAME -quiz \- test your knowledge -.SH SYNOPSIS -.B /usr/games/quiz -[ -.B \-i -file ] -[ -.B \-t -] [ category1 category2 ] -.SH DESCRIPTION -.I Quiz -gives associative -knowledge tests on various subjects. -It asks items chosen from -.I category1 -and expects answers from -.IR category2 . -If no categories are specified, -.I quiz -gives instructions -and lists the available categories. -.PP -.I Quiz -tells a correct answer whenever you type -a bare newline. -At the end of input, upon interrupt, -or when questions run out, -.I quiz -reports a score and terminates. -.PP -The -.B \-t -flag specifies `tutorial' mode, -where missed questions are repeated -later, and material is gradually introduced as you learn. -.PP -The -.B \-i -flag causes the named file to be substituted for the -default index file. -The lines of these files have the syntax: -.IP "" 4 -.nf -.ta \w'alternate 'u -line = category newline \(bv category `:' line -category = alternate \(bv category `|' alternate -alternate = empty \(bv alternate primary -primary = character \(bv `[' category `]' \(bv option -option = `{' category `}' -.PP -.fi -The first category on each -line of an index file names an information file. -The remaining categories specify the order and contents of -the data in each line of the -information file. -Information files have the same syntax. -Backslash `\\' is used as with -.IR sh (1) -to quote syntactically -significant characters or to insert transparent -newlines into a line. -When either a question or its answer is empty, -.I quiz -will refrain from asking it. -.SH FILES -/usr/games/quiz.k/* -.SH BUGS -The construct `a|ab' doesn't work in an information -file. -Use `a{b}'. //GO.SYSIN DD quiz.6 echo reversi.6 sed 's/.//' >reversi.6 <<'//GO.SYSIN DD reversi.6' -.TH REVERSI 6 -.SH NAME -reversi \- a game of dramatic reversals -.SH SYNOPSIS -.B /usr/games/reversi -[ [ -.B \-r -] -.I file -] -.SH DESCRIPTION -.I Reversi -(also known as `friends', -`Chinese friends' and `Othello') -is played on an 8\(mu8 board -using two-sided tokens. -Each player takes his turn by placing -a token with his side up in an empty square. -During the first four turns, players -may only place tokens in the four central squares -of the board. -Subsequently, with each turn, a player -.I must -capture one or more -of his opponent's tokens. -He does this by placing -one of his tokens such that -it and another of his tokens embrace -a solid line of his opponent's -horizontally, vertically or diagonally. -Captured tokens are flipped over -and thus can be re-captured. -If a player cannot outflank -his opponent he forfeits -his turn. -The play continues until the -board is filled or until no more -outflanking is possible. -.PP -In this game, -your tokens are asterisks -and the machine's are at-signs. -You move by typing in the row and column -at which you want to place your token -as two digits (1-8), -optionally separated by blanks or tabs. -You can also type -.TP -.B c -to continue the game after hitting break -(this is only necessary if you interrupt the machine -while it is deliberating). -.TP -.BR g " \fIn" -to start -.I reversi -playing against itself -for the next -.IR n "" -moves -(or until the break key is hit). -.TP -.B n -to stop printing the board after each move. -.TP -.B o -to start it up again. -.TP -.B p -to print the board regardless. -.TP -.B q -to quit (without dishonor). -.TP -.B s -to print the score. -.PP -.I Reversi -also recognizes several commands which are valid only -at the start of the game, before any moves have been made. -They are -.TP -.B f -to let the machine go first. -.TP -.BR h " \fIn" -to ask for a handicap -of from one to four corner squares. -If you're -good, you can give the machine -a handicap by typing a negative number. -.TP -.BR l " \fIn" -to set the amount of lookahead -used by the machine in searching for moves. -Zero means none at all. Four is the default. -Greater than six means you may fall asleep -waiting for the machine to move. -.TP -.BR t " \fIn" -to tell -.I reversi -that you will only need -.IR n "" -seconds -to consider each move. If you fail to respond in the -alloted time, you forfeit your turn. -.PP -If -.I reversi -is given a file name as an argument, -it will checkpoint the game, -move by move, by dumping the board onto -.IR file . -The -.B \-r -option will cause -.I reversi -to restart the game from -.I file -and continue logging. //GO.SYSIN DD reversi.6 echo ttt.6 sed 's/.//' >ttt.6 <<'//GO.SYSIN DD ttt.6' -.TH TTT 6 -.SH NAME -ttt, cubic \- tic-tac-toe -.SH SYNOPSIS -.B /usr/games/ttt -.PP -.B /usr/games/cubic -.SH DESCRIPTION -.I Ttt -is the X and O game popular in the first grade. -This is a learning program that never makes the same -mistake twice. -.PP -Although it learns, it learns slowly. -It must lose nearly 80 games to -completely know the game. -.PP -.I Cubic -plays three-dimensional tic-tac-toe on a 4\(mu4\(mu4 -board. -Moves are specified as a sequence of three -coordinate numbers in the range 1-4. -.SH FILES -/usr/games/ttt.k learning file //GO.SYSIN DD ttt.6 echo words.6 sed 's/.//' >words.6 <<'//GO.SYSIN DD words.6' -.TH WORDS 6 -.SH NAME -hangman, words \- word games -.SH SYNOPSIS -.B /usr/games/hangman -[ dict ] -.PP -.B /usr/games/words -.SH DESCRIPTION -.I Hangman -chooses a word at least seven letters -long from a word list. -The user is to guess letters one at a time. -.PP -The optional argument -names an alternate word list. -The special name `\-a' gets a particular very large -word list. -.PP -.I Words -prints all the uncapitalized words -in the word list that can be made from -letters in -.I string. -.SH FILES -/usr/dict/words the regular word list -.br -/crp/dict/web2 the the \-a word list -.SH DIAGNOSTICS -After each round, -.I hangman -reports the average number of guesses per round -and the number of rounds. -.SH BUGS -Hyphenated compounds are run together. -.PP -UNIX software is distributed without -the \-a word list. //GO.SYSIN DD words.6 echo wump.6 sed 's/.//' >wump.6 <<'//GO.SYSIN DD wump.6' -.TH WUMP 6 -.SH NAME -wump \- the game of hunt-the-wumpus -.SH SYNOPSIS -.B /usr/games/wump -.SH DESCRIPTION -.I Wump -plays the game of `Hunt the Wumpus.' -A Wumpus is a creature that lives in a cave with several rooms -connected by tunnels. -You wander among the rooms, trying to -shoot the Wumpus with an arrow, meanwhile avoiding -being eaten by the Wumpus and falling -into -Bottomless Pits. -There are also Super Bats which are likely to pick you up -and drop you in some random room. -.PP -The program asks various questions which you answer -one per line; -it will give a more detailed description -if you want. -.PP -This program is based on one described in -.I "People's Computer Company," -.I 2, -2 (November 1973). -.SH BUGS -It will never replace Space War. //GO.SYSIN DD wump.6