in reply to Re^2: The REAL reason for why they choose PHP over Perl.
in thread The REAL reason for why they choose PHP over Perl.
> Code golf is a type of recreational computer programming competition in which participants strive to achieve the shortest possible source code that implements a certain algorithm. Playing code golf is known as "golf scripting".
And as already demonstrated is not very difficult to "normalize" the code again with B::Deparse
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
C:\>perl -MO=Deparse,-p $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]} __DATA__ ($, = 42); foreach $_ ((34, 0, (-3), 9, (-11), 11, (-17), 7, (-5))) { ($* .= pack('c', ($, += $_))); } foreach $_ (reverse(split(//, $*, 0))) { (($%++) ? (($% % 2) ? push(@C, $_, $") : push(@c, $_, $")) : (push +(@C, $_, $") && push(@c, $"))); } ($C[$#C] = $/); (($#C > $#c) ? (($c = (\@C)) && ($C = (\@c))) : (($c = (\@c)) && ($C = + (\@C)))); ($% = $|); foreach $_ (@$c) { print(($_ ^ $$C[$%++])); } __DATA__
I added -p flag for parens to make precedence clearer.
most special variables are just used for obfuscation and don't serve any need.
output is - surprisingly - chargrill
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: The REAL reason for why they choose PHP over Perl.
by eyepopslikeamosquito (Archbishop) on Oct 18, 2018 at 22:48 UTC | |
by LanX (Saint) on Oct 18, 2018 at 23:27 UTC |