Yesterday, I wrote a Perl script that estimate pi. It's not exactly pi, but very close to it.
Code:
#!/usr/bin/perl
$v="\$p";$c=$v.
'=';$c.='0'.';'
.fo.r.'(';$c.='
$i='.'0'.';';$c
.='$i'.'<2';for
($x=0; $x<=3;$x
++) {$c.='0';}
$c.= ';$'.i.'++
){'.$v.'+'.'='.
'1'.'.'.'0'.'/'
;$c .=``.'($'
.i.'*'.'4.'
.'0'.'+
'.'1.'
.'0
'.
')'
.';'.
$v.'-'.
'='.'1.'.
'0'.'/'.'(
'."\$".i.' *
'.'4'.'.'.'0'.
'+'.'3.'.'0'.''.
')'.';';$c.='}$v'.
'*'.'='.'4'.'.0'.';'
.prin.t."$v*4";eval$c
This script prints "just another perl hacker"
Code:
$s="the quick brown fox
jumps over the lazy dog
";@b=(20,21,24,31,3,36,
14,26,0,1,50,49,2,11,15
,23,28,29,35,3,32,36,7,
8,2,29);foreach $x(@b){
print substr($s,$x,1);}