> Roger Hui: Sun Aug 2 12:20:10 HKT 2009
> John, how can it be random when the first
> five numbers are always in order?  ;-)

The MegaMillions 1-56 numbers are random but
displayed in ascending order because it simplifies checking.

pick2=: 1 +  ([:/:~ 56 ?~ 5:) , (46 ?~ 1:)

As a follow on to Neville's postings. These tacit solutions
are as good as they get when it comes to demonstrating
what an executable notation is all about.

I wonder what led John to think of his solution
because it is curiously out of character for someone
who's been using J for such a long time.
That said, his solution does demonstrate another
aspect of tacit programming - namely, that it facilitates program analysis.
Another way to put this is that because the tacit solution has a clear
structure it is easy to refine it.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to