develooper Front page | | Postings from July 2002

Re: more minigolf

Thread Previous | Thread Next
Chris Dolan
July 11, 2002 08:08
Re: more minigolf
Message ID:
Eugene van der Pijll wrote:
> 36, for both. However, my solution doesn't comply to one of the standard
> rules of the TPR courses, and I can't test it. But it should work.
> (This is one of the challenges I consired and discarded for the May
> contest, so I've thought about this already then.)

Inspired by this intriguing email by Eugene, I tried a rand() approach.
 This is as far as I got (a one-based solution, at 108 after obvious
compression is applied):

use Math::Random;
map$_>0&&$_<$z&&$_[$_]++,random_normal 4e4,$z/2;
$_=int 0.5+$_/$_[-1]for@_;

It *usually* succeeds up to N=5, but fails after that.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About