Cateye Stadium 03 vs. Lumicycle Halide 2003



Status
Not open for further replies.
I

Ian Smith

Guest
> "Ian Smith" <[email protected]> wrote in message
> news:[email protected]...
>
> > ciinnostttug looks OK to me.
>
> No, still don't like it. ciinnostttug is a passive thing, whereas you're describing an active
> process. cimnoopsg?

Oh well, I did say I was dabeeeillrty oabcfinstug, so it's not going to be the most eeiilqstuxy
paeilnsg laaggnue you've ever seen.

> > Haoory for Perl, in this case.
>
> I was cheering them for doing my side of the job...

Oi! that's cheating (and besides which, proves my point). After all, they didn't conclude that:

the oderr of leertts in a word dosen't maettr, the olny thing taht's iamnoprtt is taht the first and
last leettr of eervy word is in the cceorrt piioostn. The rest can be jbelmud and one is siltl able
to raed the text whiotut dcffiiltuy, aeftr eeinnrrtg it into an aaagnrm selovr.

regards, Ian SMith
--
|\ /| no .sig
|o o|
|/ \|
 
I

Ian Smith

Guest
On Fri, 10 Oct 2003 21:05:05 GMT, Simon Brooke <[email protected]uk> wrote:
> Ian Smith <[email protected]> writes:
>
> > Haoory for Perl, in this case.
>
> Ah. Explains a lot. That was the source you posted, I take it?

No, the source makes more sense:

#!/usr/bin/perl
while (chomp($line=<>)) { $line = $line . " "; $newline=""; while ($line=~/^(\S+)\s+(.*)$/) {
$word=$1; $line=$2; if ($word=~/^(\W*\w)(\w+)(\w\W*)$/) { @list=(""); $word=$2; while (length $word)
{ push @list, chop $word; } $sorted=$1 . join("",(sort @list)) . $3; } else { $sorted = $word; }
$newline=$newline . $sorted . " "; } $newline =~ /^(.*\S+)\s*$/; print "$1\n"; }

Not as elegant as it might be, but very quick to slap together. I called it 'chomple'. You can
either pipe stdin to it or give it a filename. You're welcome to it if it would be of use. (I've now
fixed teh two letter word bug - two letter words at teh ends of lines were being omitted from teh
output, but not any more).

It does sort upper case before lower, so SMith->SMith, but Smith-> Simth. You could fix that with a
defined sort routine, but I didn't think it worth the bother. If you made your sort routine a random
generator of -1,0,1 values I guess it'd do a random shuffle of the word interiors, to further test
the theory of teh supposed research, but I'm not 100% certain how perl would react to that in its
sorting function.

regards, Ian SMith
--
|\ /| no .sig
|o o|
|/ \|
 
Status
Not open for further replies.