La jenaj dosieroj devus cxeesti: LEGUMIN cxi tiu dosiero global.h scrab.h cmove.c init.c misc.c pmove.c score.c smain.c la dosieroj enhavantaj la programon kaj necesajn difinojn Makefile la `fardosiero' por fari la programon per `make' scrabble.6 la manlibra informo -------------------- Por konstrui la lancxeblajxon, tajpu `make' Vi (espereble) nun povos lancxi skrablon. Por provu, tajpu `skrablo' -------------------- La originalan programon verkis James A CHERRY en Otavao, Kanado. La Esperantigitan version programis Duncan C THOMSON. Ne vendu cxi tiun programon kontraux ion ajn. Gxi estas programita senpermese de la ludfaranta firmao. Bonvole disdoni senkoste. La verkistoj neniel respondecas pri la distribua agado de aliuloj. -------------------- Se vi havas sugestojn pri skrablo, bonvole e-posxtumi (angle) aux (pri la esperantigita versio) -------------------- Informo pri la Esperantigita versio Pro la 28-litera aboco de Esperanto, cxi tiu versiacxo (hack!) de la Skrabla programo ne estas tuta kontentiga. Mi uzas la 26-literan ASCII-an abocon, kun la `literoj' `[' kaj `\' Jen kiel tiuj literoj korespondas kontraux la Esperanta aboco: Esp ASCII valoro nombro A A 1 8 B B 4 2 C C 4 1 ^C Q 4 2 D D 2 3 E E 1 8 F F 3 2 G G 3 2 ^G [ 3 2 H H 8 1 ^H \ 10 1 I I 1 8 J J 2 3 ^J Y 10 1 K K 2 4 L L 1 4 M M 2 4 N N 1 6 O O 1 8 P P 2 3 R R 1 6 S S 1 6 ^S X 4 1 T T 1 4 U U 1 4 ^U W 8 1 V V 3 2 Z Z 5 1 Se iu volas esperantigi la regulojn de Skrablo aux la manlibran pagxon, bonvole faru tion, kaj sendu al mi - mi ne havas la tempon por fari cxion! -------------------- Cxi tiu versio de skrablo estas senvortara. Por fari vortaron, faru tiel: (1) trovu suficxe grandan vortaron por uzi (2) faru listo de la vortojn, unu po linio (3) sxangxu cxiujn literojn al majuskloj (4) sxangxu la literojn "cx gx hx jx sx ux" al "Q [ \ Y X W". (5) ordigu la listo unue per vortlongeco (6) ordigu due alfabete (ASCIIe) Ekzempla vortareto: AL EN QE LAW PER PRO TEO FARI QEFO XAFO QEVALO Mi estontece verkos programon por fari skrablo-vortaron el vortlisto... Unu problemo, kiu ekzistas, estas kiujn vortojn oni permesu kaj kiujn ne? Ekzemple "bosxafo" ja povus esti vorto, sed cxu oni rajtas uzi gxin? Cxu pluralojn? Cxu akusativojn? Cxu adverbojn kiel "lutre", "prie", ktp? Vi decidu... Gxoju! -Duncan -------------------- La tuta LEGUMINa dosiero sekvas, angle... ______________________________________________________________________________ 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 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)