This looks like fails for singleton, atom or array.

R.E. Boss wrote:
   0 1 (0 }:@, E.) 0 1 0 1 1 0 1 1 1 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0

   b=:1e6 [EMAIL PROTECTED] 2

   (b > }: 0,b)-: 0 1 (0 }:@, E.) b
1

   b=:i.0
   (b > }: 0,b)-: 0 1 (0 }:@, E.) b
1


R.E. Boss


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:programming-
[EMAIL PROTECTED] Namens Roger Hui
Verzonden: woensdag 5 maart 2008 6:52
Aan: Programming forum
Onderwerp: Re: [Jprogramming] leading edge of a boolean array

Fails on the empty list.  Likewise Oleg's solution.

   (> 0 , }:) i.0
|length error
|       (>0,}:)i.0
   ({. , 2 </\ ]) i.0
0



----- Original Message -----
From: Chris Burke <[EMAIL PROTECTED]>
Date: Tuesday, March 4, 2008 21:47
Subject: Re: [Jprogramming] leading edge of a boolean array
To: Programming forum <[email protected]>

Oleg Kobchenko wrote:
   ({. , 2 </\ ]) 0 1 0 1 1 0 1 1 1 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0

--- 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
Also:

   (> 0 , }:) 0 1 0 1 1 0 1 1 1 0 1 0
0 1 0 1 0 0 1 0 0 0 1 0

(defined as firstones in script parts).
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
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