Embarassment time - 
perl -e
'"${s}1_${s}2"=~/(.*)\1_.*?(.*)\2$/,print$s.=1+(length$1>length$2),$/for(0..98)'

The task was to produce the "Linus sequence" where either a 1 or a 2 is added
to the seed "1", such that the contiguous repeat at end of the string is
minimised at each stage.

The code's therefore pretty self explanatory, but more explanation 
can be found at google groups:
Message-ID: <[EMAIL PROTECTED]>

I'm slaughtered by my double "length", but can't see a way round it, 
and on the keyhole front, my initial "${s}"s aren't very elegant. 
Instead of
  "${s}1_${s}2"=~/(.*)\1_.*?(.*)\2$/
I tried
  "${s}_$s"=~/(.*)1\1_.*?(.*)2\2$/
but that didn't work, and I don't understand why.

Anyone got a few pointers for improving it?

Phil

=====
When inserting a CD, hold down shift to stop the AutoRun feature
In the Device Manager, disable the SbcpHid device.
http://www.cs.princeton.edu/~jhalderm/cd3/

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Reply via email to