|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 4200 (0x1068) Types: TextFile Names: »cg.6«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Chessguess/cg.6«
.. To view this file in a sensible manner, use "nroff -man cg.6 | more" .. .TH CG 6L "Sep 24, 1987" .UC 4 .SH NAME cg \- play the chess guess game .SH SYNOPSIS .B /usr/games/cg [-n] .SH DESCRIPTION .I Cg plays the game of chess guess, which was described in one of Martin Gardener's famous articles on recreational mathematics. The game starts out with a standard 8 X 8 chess board with 5 pieces on it, a King, a Queen, a Bishop, a Knight, and a Rook. The pieces are all disguised. But it isn't really a guessing game. You may query squares on the board for how may pieces attack that square. From this information you can deduce which pieces are which. The object of the game is to minimize the number of squares queried in order to find out the identity of all the pieces. .PP When the game starts up there is a help menu and a reminder on the right hand side of the screen, and the game board is to the left. To query a blank square for attacks, you move the to the square with the standard emacs(1?) or vi(1) cursor movement keys, and hit the space bar. The number of pieces that can attack that square will be displayed. To make a guess at what piece is at a certain square, you move to the square with the piece on it, and type G (for guess) and they letter that represents the piece you think it is: K for king, Q for queen, B for Bishop, N for Knight, and R for Rook. If you are correct the piece will be displayed. An individual game will end when you have guessed all the pieces, or have quit. If you don't quit, and you finish the game, a list of statistics will be displayed at the top of the screen. It is rumored that any layout of the board can be successfully guessed with only two attack queries or one attack query and one missed guess. It is certainly possible to guess all the pieces without making any attack queries, but it's probable that you won't succeed. .SH OPTIONS There is only one option: .IP \-n Display a black on black (or white on white, depending on how you view it) board instead of the standard black/white arrangement. This can also be selected from inside the program. .SH AUTHOR Jon Foreman College of Marin, in Kentfield, California. Plausible net addresses are: ...!ucbvax!dual!unicom!physh, or ptsfa!unicom!physh or hplabs!well!unicom!physh or killer!rrm!ssbn!physh .SH "SEE ALSO" curses(3X), .I "Screen Updating and Cursor Movement Optimization:" .IR "A Library Package" , .SH BUGS There are .I no bugs in .I my code, but there may be any number of undesirable features. .SH PORTABILITY Other than using curses(3X) for screen optimization, this code should be easily portable to any machine running UNIX(r). There are no particularly machine dependent things with the exception of "isupper()" and "islower()" which rely on [A-Z] and [a-z] being contiguous. .SH PROBLEMS There are other ways of implementing this program, and I leave it to the general body of students and others who wish to explore new and different ideas to implement them. Here are some suggestions. Instead of displaying disguised pieces, don't display the pieces at all. This makes the game harder. Another alternative would be to put all the non pawn types of pieces on the board (1 King, 1 Queen, 2 Bishops (one on a while diagonal, and one on a black), 2 Knights, and 2 Rooks.) Still another would be to just display all the attacks, and to divine the location and types of all the pieces from just this information. The squares under the pieces should show the number of attacks on that piece. .SH NOTES The code for this game has certain landmarks which people seem to pick out every time. For instance, the 'for' loops in the nitemove() function. In addition, I think that the program, while bigger, is a better sampler for the use of curses(3X) than either twinkle or life, which are listed in the curses documents. At least the help() function does expand on the use of windows, which is not covered at all well in the curses documents that I have. In any case, I leave this program in the custody of the public domain, so that all may benefit. If you really enjoy it, send a thank you letter so that I may know that some of my effort has been of use.