======================================================================== FOR MAY ... A NEW POTM CHALLENGE TO CONSIDER ... The CAT-DOG POTM! (IF YOU KNOW OF ANYONE WHO MIGHT FIND THIS FUN - PLEASE HAVE THEM SEND MAIL TO homxb!fah TO GET ON THE MAILING LIST ... ANYONE IS ELIGIBLE TO PARTICIPATE .... THE MORE THE MERRIER!! ... =Fred) ======================================================================== There is an old word game* that asks you to take a word, say CAT, change only one letter at a time, and eventually reach a second word, like DOG. With my rules, you can rearrange the letters each time. The major restriction is that all the steps along the way have to be legitimate words. Thus, one solution might be: START: CAT STEP 1: change C to R to get RAT STEP 2: change R to G and rearrange to TAG STEP 3: change A to O and rearrange to GOT STEP 4: change T to D and rearrange to DOG There are, without too much thought, shorter solutions - with nothing shorter than three steps possible in this case. Repeated letters are changed one at a time, for example: BEES-BETS-BITE-NITE-VINE-HIVE (5 moves) ^ ^ ^ ^ ^ Another example might be: COLD-MOLD-MOLT-POTM-TOMB-MOTE-MODE-CODE-DOCK-DUCK (9 moves) ^ ^ ^ ^ ^ ^ ^ ^ ^ But wait - is "POTM" a legitimate word??? An interesting question! So, when your program runs - I'll give it a list of legitimate words (the dictionary) from which to choose so there will be no confusion! Of course, you'll have no idea what the dictionary contains when you write your entry! * the game was invented by Lewis Carroll and words than can be transformed in this manner are called "Carrollinian Doublets =================== now that you have the basics down, here's the POTM: 1. Create a program which is executable on homxb (Amdahl) that takes three arguments as follows: a.out FULLPATH WORDONE WORDTWO where: FULLPATH is the full path of a file containing the dictionary, described below WORDONE is the starting word (in lower case) WORDTWO is the final word (in lower case) 2. The program should output a series of words from the dictionary such that the first word is WORDONE, the last word is WORDTWO, and each word differs by exactly one letter from the previous word. (You may rearrange the letters, but only one may change.) Each word is on a separate line and must be in the dictionary. For example, "a.out /tmp/dic cat dog" might produce 5 lines on standard output: cat rat tag got dog Provided of course that all the words were in the /tmp/dic dictionary. Note that a solution for a start and stop words that are anagrams of one another would output three lines: e.g.: rat->cat->tar 3. If there is NO solution possible with the provided dictionary, the program should print one line containing the word 'none'. 4. The dictionary provided by FULLPATH will be an ascii file such that: a) one word per line b) all words are the same length as both WORDONE and WORDTWO c) word length is at least 3, and no more than 9 d) the file will contain words in lower case using [a-z] letters only (no contractions/hyphens/capitals/etc.) e) there will be at least 500 words and at most 8000 words in the dictionary f) the words will be alphabetized within the file g) WORDONE and WORDTWO will be in the dictionary h) each puzzle may use different dictionaries i) the words in the dictionary NEED NOT pass spell, (indeed, they need not be "words" in ANY language!) j) you may not modify the dictionary file 5. Winning entry will be determined as follows: a) ten sets of starting and ending words will be presented, each using a potentially different dictionary b) a program's score will be the total number of steps for the solutions to all ten puzzles, provided the solutions are valid according to the rules. Low score wins. (Steps are counted as shown in the examples.) c) in the event of ties, the "FASTEST" program will win. Speed will be determined by adding sys+user time from the output of timex for all ten puzzles. (repeated and averaged five times if the top entries are real close!) d) I am the sole arbiter. If you wish, I can uuto you a sample dictionary of a couple thousand four letter words to experiment with - I will use this file to system test entries, but NOT for the 10 puzzles. ======================================================================= As always, to enter just uuto me your source code and instructions on how to compile it (if necessary) ... if compilation is complicated, uuto me a makefile as well! homxb is a standard exptools supported Amdahl. Use the line: uuto yourfile homxb!fah and drop me some mail to let me know what to do with it! I'll test it and give you a quick response. You may submit a replacement entry at any time before midnight June 13, 1993. Only your last entry will be judged. I will try to keep those who send entries apprised of the status on a weekly basis - so it pays to send in your entry early! =Fred ... Hey - have fun with it!