Superior solution!

R.E. Boss


> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] Namens Zsbán Ambrus
> Verzonden: woensdag 5 maart 2008 13:44
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] leading edge of a boolean array
> 
> On Wed, Mar 5, 2008 at 6:05 AM, bill lam <[EMAIL PROTECTED]> wrote:
> > how to find the leading edge of a boolean array,
> >  eg. for this array
> >    0 1 0 1 1 0 1 1 1 0 1 0
> >
> >  I want the result as
> >    0 1 0 1 0 0 1 0 0 0 1 0
> 
> I recommend this:
> 
>    ]a =: 0 1 0 1 1 0 1 1 1 0 1 0
> 0 1 0 1 1 0 1 1 1 0 1 0
>    (>|.!.0) a
> 0 1 0 1 0 0 1 0 0 0 1 0
> 
> Ambrus
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to