I thought I should clean it up a little, as it seemed nasty to be so kludgy on 
top of Roger's code.

   f=:  (/: #each) @: (#:@i.@(2^#) <@|.@#"1 ]) @ |.
   f 1 6 6 8
┌┬─┬─┬─┬─┬───┬───┬───┬───┬───┬───┬─────┬─────┬─────┬─────┬───────┐
││1│6│6│8│1 6│1 6│6 6│1 8│6 8│6 8│1 6 6│1 6 8│1 6 8│6 6 8│1 6 6 8│
└┴─┴─┴─┴─┴───┴───┴───┴───┴───┴───┴─────┴─────┴─────┴─────┴───────┘

Cheers, bob


 
> On May 7, 2016, at 10:24 PM, robert therriault <[email protected]> wrote:
> 
> f=: (|. each) @: (/: #each) @: (#:@i.@(2^#) <@#"1 ]) @|.

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

Reply via email to