Probably not efficient:

   load 'regex'
   b#~-.#&>(<'10+1') rxmatches&.><"1 '01'{~b
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 1 0
0 1 1 1
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1

On 12/20/07, Raul Miller <[EMAIL PROTECTED]> wrote:
>
> Does this match what you are looking for?
>    b=:#:i.16
>    cntg=:((1 [EMAIL PROTECTED]@E."1]) (< [EMAIL PROTECTED] *&*) 0 1{:@[EMAIL 
> PROTECTED]"1])&(0,.])
>    (#~ cntg) b
> 0 0 0 0
> 0 0 0 1
> 0 0 1 0
> 0 0 1 1
> 0 1 0 0
> 0 1 1 0
> 0 1 1 1
> 1 0 0 0
> 1 1 0 0
> 1 1 1 0
> 1 1 1 1
>
> Thanks,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to