develooper Front page | perl.golf | Postings from July 2002

Re: more minigolf

Thread Previous | Thread Next
From:
perl-golf
Date:
July 11, 2002 10:23
Subject:
Re: more minigolf
Message ID:
agkets$u99$1@post.home.lunix
In article <20020711170042.GB23225@ruunat.phys.uu.nl>,
	Eugene van der Pijll <E.C.vanderPijll@phys.uu.nl> writes:
> En op 11 juli 2002 sprak Chris Dolan:
>> #!perl
>> use Math::Random;
>> $z=pop;
>> map$_>0&&$_<$z&&$_[$_]++,random_normal 4e4,$z/2;
>> $_=int 0.5+$_/$_[-1]for@_;
>> print"@_\n"
>> 
>> It *usually* succeeds up to N=5, but fails after that.
> 
> If you only want to go up to 4, you can do a lot better than that (27).
> 
> #!perl
> @a=11**pop=~/./g;print"@a
and of course:
26 print"@{[11**pop=~/./g]}\n"
> "
> 
> Along the same lines, for N<8 (40):
> 
> #!perl
> @a=map$_+0,101**pop=~/^.|../g;print"@
> "
39 print"@{[map$_+0,101**pop=~/^.|../g]}\n "

When only going upto N<9:
40 @F[$_%9]++for glob"{,1}"x pop;print"@F\n"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About