You didn't think I would stop at 128 did you?
To the seven main options:
perl camel.pl "" normal camel
perl camel.pl q quine (program prints itself)
perl camel.pl m mirror (camel looking in the mirror)
perl camel.pl i inverted camel
perl camel.pl u upside-down camel
perl camel.pl r rotated camel
perl camel.pl h horizontally-squashed camel
perl camel.pl v vertically-squashed camel
I added an optional second parameter, the character
to fill in the camel with (default '#'). For example:
perl camel.pl hv small camel (as before)
perl camel.pl hv "$" small wealthy camel
Since there are 94 printable characters in the range !-~,
I make this at least 128 * 94 = 12,032 different camels.
Here is the new source program:
$~=uc shift;$:=pop||'#';open$%;chop(@~=<0>);$~=~R&&(@~=map{$-=$_+$_;
join'',map/.{$-}(.)/,@~}$%..33);$|--&$~=~H&&next,
$~!~Q&&eval"y,!-~,$:,",$~=~I&&eval"y~ $:~$: ~",$~=~M&&($_=reverse),
print$~=~V?/(.).?/g:$_,$/for$~=~U?reverse@~:@~
After hitting the golfing wall, I had to improve the compactness
of sightly encoding to squeeze this source program into a single
camel. I will update the next release of Acme::EyeDrops with a
new Compact attribute, which will produce a more compact sightly
encoding, similar to the camel shown below.
Enjoy,
/-\ndrew
camel.pl:
(Save all text between ----- lines below, including
leading and trailing space-filled lines)
--------------------------------------------------------------------
''=~('(?{'.(
('`')| '%').('['^'-').
('`'|'!'). ('`'|',').'"\\$~'.
'='.("\["^ '.').( '`'|'#').('{'^'[').(
'['^'(').('`'|'(').( '`'|')').('`'|('&')).(
'['^'/').(';\\$:=').( '['^'+').('`'|'/').('['
^'+').'||'."'".'#'. "'".';'.('`'|'/').('['^'+'
).('`'|"\%").( '`'|'.').'\\$%;'.('`'|"\#").(
'`'|'(').('`'| '/').('['^'+').'(\\@~=<'.("\^"^(
'`'|'.')).'>)'. ';\\$~=~'.('{'^')').'&&(\\@~='.('`'
|'-').('`'|'!') .('['^'+').'\\{\\$-=\\$_+\\$_;'.("\`"|
'*').('`'|'/'). ('`'|')').('`'|'.')."'"."'".','.('`'|'-'
).('`'|"\!").( '['^'+').'/.\\{\\$-\\}(.)/,\\@~\\'.''.''.
'}\\$%..'.('^' ^('`'|'-')).('^'^('`'|'-')).');\\$|--&\\'.
'$~=~'.('`'^'(').'&&'.('`'|'.').('`'|'%').('['^'#').("\["^
'/').',\\$~!~'.('{'^'*').'&&'.('`'|'%').('['^'-').('`'|'!')
.('`'|',').'\\"'.('['^'"').',!-~,\\$:,\\",\\$~=~'.('`'^')'
).'&&'.('`'|'%').('['^'-').('`'|'!').('`'|',').'\\"'.("\["^
'"').'~'.('{'^'[').'\\$:~\\$:'.('{'^'[').'~\\",\\$~=~'.('`'
^'-').'&&(\\$_='.('['^')').('`'|'%').('['^'-').('`'|'%').(
'['^')').('['^'(').('`'|'%').'),'.('['^'+').('['^')') .+(
'`'|')').('`'|'.').('['^'/').'\\$~=~'.('{'^'-').'?' .((
'/')).'(.).?/'.('`'|"'").(':\\$_,\\$/').( '`'|'&') .+(
'`'|'/').('['^')').'\\$~=~'.('{'^'.'). ('?').( '['
^')') .('`'|'%').('['^'-').('`'|'%') .("\["^ ')'
).('['^'(').('`'|'%').'\\@~'. ':\\@'. '~'
.'"})'); $:='.'^'~' ;($~)= ('@')| ((
"\(")); $^="\)"^ '[';$/ ="\`"| ((
"\.")); $_="\("^ "\}"; ($,)= (
"\`")| "\!";$\= ')'^ '}';
$:='.' ^"\~";$~= '@'| '(';
($^)= ')'^'['; ($/) ='`'
|'.'; $_='('^ '}'; ($,)
='`' |"\!"; ($\) =')'
^'}' ;$: ='.' ^'~'
;$~= '@' |(( '('
)); $^= ')' ^((
'[' )); $/= '`'
|(( '.' )); $_
=( "\(")^ ((
(( '}')) ))
;( $,)='`'| ((
'!' ));( ($\)) =(
')' )^'}'; ($:) =((
'.') )^'~';$~ =(( '@')
)|'('; $^=')'
^'[';$/= '`'|'.'
--------------------------------------------------------------------