Skip to content

Instantly share code, notes, and snippets.

@abuzarhamza
Created May 7, 2011 08:33
Show Gist options
  • Save abuzarhamza/960325 to your computer and use it in GitHub Desktop.
Save abuzarhamza/960325 to your computer and use it in GitHub Desktop.
$|=3,141592;sub _
{print@_}sub o{_++$O[0
];_ 0for 1..$#O}sub O{$;=int
$=/10,'0/^ ^';if($;<9)
{_$_ for @O;;@O=()
;0}push @O,$;;0
,;push@ O,'.'if
$^==1; 0;if($;
==10){ print ,o,@O=(
)}}$~= 1000000 ;$-=10*
(q/@O= digits of pi =10/,1)
*int($~ /3)+1;$
_=2for@ ,[0..$-]
,;for$^ (1..$~){
$:=$-;$O =0;until
($:<0){$/= 2*$:+1;$/=
10if$/==1;$==10*$,[$:]+$O;$,
[$:]=$=%$/;$O=int($=/$/
)*$:--,10}O}o
@abuzarhamza
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment