[Neworleans-pm] Fwd: Perl 'Expert' Quiz-of-the-Week #22

E. Strade, B.D. estrabd at yahoo.com
Thu Aug 26 08:20:17 CDT 2004




=====
http://www.brettsbsd.net/~estrabd

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

----- Original message -----
From: "Mark Jason Dominus" <mjd at plover.com>
To: perl-qotw at plover.com
Date: Wed, 25 Aug 2004 23:26:57 -0400
Subject: Perl 'Expert' Quiz-of-the-Week #22


IMPORTANT: Please do not post solutions, hints, or other spoilers
        until at least 60 hours after the date of this message.
        Thanks.

IMPORTANT: S'il vous plaît, attendez au minimum 60 heures après la
        date de ce message avant de poster solutions, indices ou autres
        révélations. Merci.

BELANGRIJK: Stuur aub geen oplossingen, hints of andere tips in de
        eerste 60 uur na het verzendingstijdstip van dit
        bericht. Waarvoor dank.

Qing3 Zhu4Yi4: Qing3 Ning2 Deng3Dao4 Jie1Dao4 Ben3 Xin4Xi2 Zhi1Hou4 60
        Xiao3Shi2, Zai4 Fa1Biao3 Jie3Da2, Ti2Shi4, Huo4 Qi2Ta1 Hui4
        Xie4Lou4 Da2An4 De5 Jian4Yi4.  Xie4Xie4.

----------------------------------------------------------------

Write a program, 'wordladder', which gets two arguments, which are
words of the same length, and which constructs and prints a "word
ladder" from the first word to the second word.

A word ladder from word AAA to word BBB is a sequence of dictionary
words such that:

1. the first word in the sequence is word AAA
2. each word in the sequence after the first differs from the previous
   word in exactly one letter position
3. the last word in the sequence is word BBB

For example, given the two words "love" and "hate", the program might
print the word ladder:

        love
        hove
        have
        hate

Or it might print:

        love
        lave
        have
        hate

It might also print a longer word ladder, such as

        love
        lore
        lobe
        robe
        role
        rose
        lose
        lost
        most
        mosh
        moth
        math
        hath
        hate

If the program is unable to find a word ladder, it should print an
appropriate error message to the standard error, and exit with a
failure status.

The program should also accept an optional third argument, which, if
specified, is the name of a dictionary file which contains the
permissible words.  If the third argument is omitted, the program
should use a default dictionary.

Sample word lists are available from
        http://perl.plover.com/qotw/words/




More information about the NewOrleans-pm mailing list