Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Somersaulting camel

by eyepopslikeamosquito (Canon)
on Jun 28, 2002 at 07:30 UTC ( #177952=note: print w/ replies, xml ) Need Help??


in reply to Somersaulting camel

Update: Creating an EyeDrops-generated camel inevitably degenerates into a golf crack-pipe smoking session on the source text. So it has proved here. Golfing the original source program has allowed me to support a new 'back-flip' command-line argument as follows:

perl camel.pl camel forward somersaults as before perl camel.pl b camel somersaults backwards perl camel.pl please do a backward somersault same thing camel.pl: (Save all text between the ------ lines below) ------------------------------------------------------------------ ''=~('(?{'.( ('`')| '%').('['^'-'). ('`'|'!'). ('`'|',').'"\\$~=' .('['^'+') .('`'| '/').('['^'+').'||'. "'"."'".';'.('`'|'/' ).('['^'+').('`'|'%'). ('`'|'.').('\\$%;').( '['^'"').(',!-~,#,,').( '['^'(').',(.).,\\' .'$+,'.('`'|"'").('['^'(') .',\\$~&&(\\$' .'_='.('['^')').('`'|('%')).( '['^'-').('`'| '%').('['^')').('['^'(').(('`')| '%').')'.("\`"| '&').('`'|'/').('['^"\)").'\\@~='.( '`'|"'").("\["^ ')').('`'|'%').('['^'+').('\\$|--,('). "'"."'".(')').( '['^'#').('^'^('`'|'/')).(':'&'=').',<'. ('^'^('`'|'.') ).'>;\\@;='.('`'|'-').('`'|'!').('['^'+') .'~~'.('['^')' ).('`'|'%').('['^'-').('`'|'%').('['^')'). ('['^'(').('`'|'%').','.('['^')').('`'|'%').('['^'-').('`' |'%').('['^')').('['^'(').('`'|'%').'\\@~;'.('`'|'-').('`'| '!').('['^'+').'\\{'.('['^'(').('['^'"').('['^'(').(('[')^ '/').('`'|'%').('`'|'-').'\\$^'.('`'^'/').'=~'.('{'^"\,").( '`'|')').('`'|'.').'?'.('`'^'#').('`'^',').('{'^'(').(':'). "'".('`'|'#').('`'|',').('`'|'%').('`'|'!').('['^')')."'". ';(\\$-=\\$_%'.('^'^('`'|'-')).')||(--\\$|,'.('`'|'-' ).( '`'|'!').('['^'+').'\\$_='.('['^')').('`'|'%').('[' ^(( '-'))).('`'|'%').('['^')').('['^'(').('`' |('%')). ',' .'\\@~,\\@;);'.('['^'+').('['^(')')).( '`'|')' ).( "\`"| '.').('['^'/').'\\$\\"'.("\["^ ('#')). '(' .'\\$=/'.('^'^('`'|'-')).'*'. (('`')| '!' ).("\`"| '"').('['^ "\("). '\\$|' .+ ('*').( '^'^('`' |',')) .'-\\' .+ '$-),'. '\\$_,'. '\\$' .'/'. ( ('`')| ('&')).( '`'| '/') .('['^ ')').'\\' .'$' .'-' .'&'. (('^')^( '`'| '/') ).'?' .'\\@;' .':' .''. '\\' .'@~;' .''. ('[' ^'(' ).( '`'| ',') .''. ((( '`' ))| '%' ).( '`' |(( '%' ))) .+( '[' ^(( '+' ))) .+ (( '!')). (( (( '\\') )) ). '$%\\}'. (( ((( '\\' ))))) .+ '$' .'%..' .''. ((( '^') )^("\`"| '/' )).( "\^"^( ('`')| ('/'))). '"})'); ------------------------------------------------------------------

camel.pl above was created with:

perl gencamel.pl >camel.pl

where gencamel.pl is:

use Acme::EyeDrops qw(sightly); my $src = <<'END_SRC_STR'; $~=pop||'';open$%; y,!-~,#,,s,(.).,$+,gs,$~&&($_=reverse)for@~=grep$|--,('')x18,<0>; @;=map~~reverse,reverse@~; map{system$^O=~Win?CLS:'clear'; ($-=$_%3)||(--$|,map$_=reverse,@~,@;); print$"x($=/3*abs$|*2-$-),$_,$/for$-&1?@;:@~; sleep!$%}$%..11 END_SRC_STR $src =~ tr/\n//d; my $prog = sightly( { Regex => 1, Compact => 1, Shape => 'camel', SourceString => $src } ); my @a = split(/\n/, $prog); my $max = 0; length > $max and $max = length for @a; $_ .= ' ' x ($max - length) for @a; print " $_ \n" for @a;

One more thing: camel.pl should still work if you add a leading #!/usr/bin/perl -w line followed by a single blank line; if you don't add the blank line, the camel may lose one eye and somersault erratically.


Comment on Re: Somersaulting camel
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://177952]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (16)
As of 2015-07-06 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (78 votes), past polls