On 5/21/08, John Randall <[EMAIL PROTECTED]> wrote:
> Roger Hui wrote:
> > enum=: ,@|:&.#:"1 @ (#: i.) @ (2&^) @ ,~
>
> Nice one.  Do you have an inverse for this?

   F2=: ,@|:&.#:
   G2=: |:@(_2]\0&,^:(2&|@#))&.#:

    (-: [EMAIL PROTECTED]) 1 9
1

Most of the complexity of G2 has to do with
replacing a potentially missing zero.  There's
probably a better way of doing that.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to