The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this quiz
48 hours have passed from the time on this message.
Support Ruby Q. by submitting ideas as often as you can:
Suggestion: A [QUIZ] in the subject of emails about the problem helps
on Ruby T. follow the discussion.
When someone asked for a set of exercises on Ruby T. this week, one of
answers was to check out the Code Katas by Dave T… I’m a big fan
problems myself, so let’s do one of them.
This week’s quiz is to write a program that takes two words as program
arguments. The words will be the same length. Please also support a -d
command-line option that can be used to switch dictionary files (one
line), but it’s fine to use a reasonable default for your system.
The output of your program is to be a word chain, printing one word per
The first word in the chain is the first argument to the program and the
word is the other argument. All other words in the chain vary by
letter from the words surrounding it. If a chain can not be formed from
arguments using the selected dictionary, print a simple error message.
Here are some sample runs of my solution, so you can see how chains
$ ruby word_chain.rb work play work pork pory pony piny piky puky puly paly paty katy kath hath hash pash push puss poss post pout prut prat plat play $ ruby word_chain.rb lead gold lead load goad gold $ ruby word_chain.rb love hate love hove have hate
Aim for the shortest paths if you can find them (the above examples may
them) and fast running times.