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

Re: more minigolf

Thread Previous | Thread Next
From:
Eugene van der Pijll
Date:
July 11, 2002 10:01
Subject:
Re: more minigolf
Message ID:
20020711170042.GB23225@ruunat.phys.uu.nl
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
"

Along the same lines, for N<8 (40):

#!perl
@a=map$_+0,101**pop=~/^.|../g;print"@
"

(-ugene
-- 
Not that the story need be long, but it will take a long while to make
it short. -- |-|enry |)avid 7`horeau

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