From: Ruby Quiz Date: 2007-09-21T21:27:07+09:00 Subject: [QUIZ] Shirt Reader (#140) The three rules of Ruby Quiz: 1. Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. 2. Support Ruby Quiz by submitting ideas as often as you can: http://www.rubyquiz.com/ 3. Enjoy! Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone on Ruby Talk follow the discussion. Please reply to the original quiz message, if you can. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Sun Microsystems handed out some fun shirts at the LSRC. The graphic on the front looks something like: sun image star image + T + up arrow E + perfume bottle image + sea shells image This is a clever advertisement for their "Sun Startup Essentials" program. This week's Ruby Quiz is to write a program that can read such shirts. At the basic level, we will assume the user will feed us the right words: $ ruby read_shirt.rb e scent shells essentially Hopefully your solution will be smarter than mine, which, as you can see, only gets close. It may be better to give a few possible choices instead of just the best match. Of course, the problem comes when you guess the wrong word. My first thought was of a perfume bottle, as my description shows, but the correct word was scent. For bonus points, see what you can do about this problem. One idea might be to allow alternatives for a segment of the word. Another might be to hit the thesaurus, which does list scent as a synonym for perfume.