... Skip’s t had a trailing zero,  but you can’t take that as given, so need to 
append in case the last entry is 1

Sent from my iPad

> On 30 Mar 2021, at 06:29, Raul Miller <[email protected]> wrote:
> 
> The ,0 is at the end because Skip specified that the list was zero
> delimited, and verbs of the form u;._2 are delimited by the last item
> in the argument list.
> 
> I hope this helps,
> 
> -- 
> Raul
> 
> On Tue, Mar 30, 2021 at 1:11 AM 'Samir' via Programming
> <[email protected]> wrote:
>> 
>> Greate, but why the ,0 at the end of the code?
>> 
>>> On March 29, 2021 10:41:37 PM GMT+02:00, Clifford Reiter 
>>> <[email protected]> wrote:
>>>  0-.~#;._2 t,0
>>> 2 3 1 5 1
>>> 
>>> 
>>> 
>>> 
>>>> On Mon, Mar 29, 2021 at 4:34 PM Skip Cave <[email protected]> wrote:
>>>> 
>>>> Given a vector t of ones and zeros"
>>>> 
>>>> t=. 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 1 0
>>>> 
>>>> 
>>>> How can I code a verb gp that will enumerate the sizes of each
>>>> zero-delimited group of ones in the vector t?
>>>> 
>>>> For example:
>>>> 
>>>> 
>>>> gp t
>>>> 
>>>> 2 3 1 5 1
>>>> 
>>>> 
>>>> Skip Cave
>>>> Cave Consulting LLC
>>>> ----------------------------------------------------------------------
>>>> 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
> ----------------------------------------------------------------------
> 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