From: Ross Bamford Date: 2006-04-23T00:53:14+09:00 Subject: Re: Text Munger (#76) On Sat, 2006-04-22 at 23:31 +0900, James Edward Gray II wrote: > On Apr 22, 2006, at 5:28 AM, Ross Bamford wrote: > > > $ ./munger.rb test.txt > > Attehcaed is my r辿smu辿. > > $ ./munger.rb test.txt > > Atthaceed is my r辿ums辿. > > $ ./munger.rb test.txt > > Attacheed is my r辿msu辿. > > $ ./munger.rb test.txt > > Attcaehed is my r辿mus辿. > > $ ./munger.rb test.txt > > Attecahed is my r辿msu辿. > > Why are the e's not moving? My solution scrambles only part of the inside of the word, depending on the word length, and favours keeping more from the start of the word. So with this example it's taking the six letter 'r辿msu辿' and deciding to scramble 3 letters, 'msu' (remains after we take two from the start, one from the end). So with that input, the e's wouldn't be touched. I just didn't think about that before I posted - the second output I posted showed some longer accented words with the e's moving around properly :). -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk