home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume14
/
scrabble2
/
part01
/
README
< prev
next >
Wrap
Text File
|
1993-01-27
|
7KB
|
167 lines
README file for scrabble
--------------------
List of files
This is a UNIX version of the crossword-puzzle board game, Scrabble(TM),
by Selchow & Righter. There are ten files needed to compile and run scrabble:
.c files: cmove.c (Computer move algorithm)
init.c (Static declarations)
misc.c (Like it says, miscellanous junk)
pmove.c (Human player move routines)
score.c (Word finding & scoring)
smain.c (Main program, initializing, end game)
.h files: globals.h (Globally-accessible variables)
scrab.h (Macros and structs)
text: scrabbledict (Scrabble dictionary file)
makefile: Makefile
As well, there are two other files:
manual: scrabble.6 (To be placed in your /usr/man/man6 directory)
README: README (This file)
--------------------
To build the executable file, type
make
scrabble should now be ready to run. To try it out, type
scrabble
--------------------
System dependencies
1. scrabble has been compiled and run successfully on four platforms: Apollo
Domain, Sun SPARC, Solbourne, and HP 735. The only file that gave any
difficulty was the file misc.c. In particular, the calls to the random-number
generator were different on certain platforms. There are two lines of
significance: line 222
srandom( tp.tv_sec % 65536 - 32768 );
and line 226
return( (long) random() );
The call to srandom() is for seeding the random number generator with the time
of day, and the call to random() is for returning a long integer random number.
If these calls give trouble when compiling, a possible solution is to replace
the call to srandom() with one to srand48(), viz.
srand48( tp.tv_sec % 65536 - 32768 );
and the call to random() with lrand48(), viz.
return( (long) lrand48() );
If this does not fix the problem, srandom() may be replaced with srand(), and
random() replaced with a call to rand(). These are inferior random number
generators, but they should suffice for scrabble.
2. scrabble also exploits the terminal's full screen capabilities, using the
termcap library file. If your terminal does not have an entry in this file,
scrabble may not work. However, most terminals WILL have such an entry, and
scrabble should be displayed properly.
3. The dictionary file supplied, scrabbledict, is an 88,000-word dictionary.
scrabble assumes that this file will be located in the same directory in which
the command to execute scrabble is entered; the declaration for the name of
the dictionary file is in scrab.h:
#define DICT_FILE "scrabbledict"
Note that this is a relative path name, so it might require changing. If, for
example, scrabble was to be placed in /usr/games, and the dictionary was
placed in /usr/games/lib, then this line should be changed to
#define DICT_FILE "/usr/games/lib/scrabbledict"
This dictionary includes several words that might be considered rude or inde-
cent. However, swear words are certainly valid in scrabble. The following is
a (hopefully exhaustive) list of "offensive" words that could be removed from
scrabbledict:
bastard bastards bitch bitched bitches bitching bitchy bullshit cunt cunts
dick dicks fart farted farting fart horseshit nigger niggers penis penises
piss pissed pisses pissing poop pooped pooping poops pussy pussies shit shits
shitting tit tits vagina vaginae vaginal vaginally vaginas
Be warned! There might be other words that some might consider improper for
use in scrabble.
If a different dictionary is to be used, it MUST have the following proper-
ties for scrabble to work properly:
1. It must be sorted from shortest words (two letters) to longest words
(fifteen letters). Furthermore, it must contain no blank lines or
words of one character (like "A", for example). Words longer than
fifteen characters are also unacceptable.
2. Within each word length, it must be sorted alphabetically.
3. Words absolutely MUST be all capitals. Any words with punctuation in
them (such as hyphens and apostrophes) will be ignored.
These properties imply that /usr/dict/words will NOT work for scrabble!
Thus, the first line of the dictionary file might be "AD", followed by "AM",
etc., down to "YE", then "ABA", etc., down to "ZOOGEOGRAPHICAL".
Lastly, note that playing a word longer than nine letters in scrabble is
a rare occurrence. To save space, the dictionary could only include words up
to nine letters long. This will (approximately) halve the size of most
dictionaries.
4. The computer moving algorithm, coded in cmove.c, runs faster if it is
optimized when compiling it. Some UNIX implementations automatically opti-
mize files when they are compiled from a Makefile. Others do not. Check the
man pages on the C compiler on your computer to see how to optimize a program
during compilation. If you can't be bothered, try the following lines:
cc -O -o cmove.o -c cmove.c
make
This might make the computer players search the board significantly faster.
As well, the algorithm is fairly CPU-intensive. Other jobs tend to slow
down when the computer is playing.
5. scrabble is a memory hog; it requires at least 1.5 meg to run. The actual
amount is probably closer to 2 meg. The reason for this is that the diction-
ary is held in memory to speed up searching it. For most UNIX platforms, it
should not be a problem for a single process to use this amount of memory.
But be warned!
--------------------
Program author and distribution policy
scrabble was written over a period of about three weeks by James A. Cherry,
in Ottawa, Ontario, Canada. It was written as a programming exercise, and also
to settle the question, "If a computer played its best move at Scrabble every
time, would it beat a really good player?" The author considers himself a
moderately good player, and the answer to the question turned out to be, "Yes,
by a big margin usually." After others expressed interest in playing the
computer version, computer skill levels were added.
IMPORTANT: scrabble was not written with the permisson of Selchow &
Righter, and to charge others for it would very likely be an infringement of
copyright. If it is to be distributed, it must be done so for free. It may,
however, be distributed to as many others as desired. The author is in no way
liable for the actions of others with regard to their distribution methods,
i.e., if you charge for it and get caught, don't come crying to me!
--------------------
Comments, suggestions, etc.
If you have any comments about scrabble, feel free to email the author at
jac@doe.carleton.ca.
As of this writing, there are no known bugs in the code. Please write to
the address above, with a description of the circumstances, if something funny
happens.
Enjoy!
(README ends here)