Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!yale!think!samsung!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Randal's one-liners Message-ID: <7250@jpl-devvax.JPL.NASA.GOV> Date: 2 Mar 90 20:12:50 GMT References: <15214@bfmny0.UU.NET> <15216@bfmny0.UU.NET> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 19 In article <15216@bfmny0.UU.NET> tneff@bfmny0.UU.NET (Tom Neff) writes: :This is three lines out of courtesy to newsreading software -- it :runs fine as one long line.. :-) : :@a=split(//,'1111211111131223311361214223121412311341121111222123616111111122'. :'21233212615112114212321211121111222123321120');for$r(@a){for(1..$r){vec($s,$i, :1)=$v;$i++;}$v^=1;}print"$s\n"; Or, more concisely, for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"')) {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n"; And a special version just for Randal: grep(do{for(ord){$i+=$_%8;grep(vec($s,$i++,1)=1,5..($_>>3||print"$s\n"));}}, (@x=split(//,"))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)\7"))); Larry