From: James Gray Date: 2007-12-08T15:26:52+09:00 Subject: Re: Word Loop (#149) On Dec 7, 2007, at 11:40 PM, Eugene Kalenkovich wrote: > "Alex Fenton" wrote in message > news:x7j6j.1781$h35.792@newsfe2-gui.ntli.net... >> Phrogz wrote: >>> On Dec 7, 1:45 pm, Ruby Quiz wrote: >>>> Given a single word as input try to find a repeated letter inside >>>> of it >>>> such >>>> that you can loop the text around and reuse that letter. For >>>> example: >>>> >>>> $ ruby word_loop.rb Mississippi >>>> i >>>> p >>>> p >>>> Mis >>>> ss >>>> si >> >> >> >>> Maybe it's because it's a Friday afternoon, but I don't understand >>> the >>> quiz problem. Could someone who understands this try explaining it >>> (without, of course, discussing any code or even pseudo-code to >>> approach it). >> >> It took me a few monents too. The letters have to be arranged in a >> grid so >> that by moving one square at a time, the word is spelled out. The >> test is >> to see whether the word can be spelled out by, at some point, >> moving over >> the same grid square twice. >> >> I'm taking from the MISSISSIPI example that moves have to be in the >> same >> direction as the last move, or at a 90 degree angle to it, >> otherwise it >> could be spelled by moving up back onto "S" after the second "I" in >> the >> bottom right. >> >> a >> > > Hmm.. > Looks like mississippi is ambiguous, what about > > I > P > P > I > MISS > SI > > ? I don't see how this works with 90 degree turns in a clockwise direction, as mentioned earlier in this thread. Of course, I'm never one to discourage experimentation. James Edward Gray II