In ijrd there's a constraint that j must be strictly less than i.

So you might try (0;s0;m0;1 0 0 1) ;: test1

Note that this will fail if the right argument to ;: is empty.

Was there anything else that you did not understand about my approach there?

Thanks,

-- 
Raul

On Fri, Jan 13, 2023 at 10:48 AM Pawel Jakubas <jakubas.pa...@gmail.com> wrote:
>
> Thanks Raul.
>
> I realized I do not understand your S0, how you come up with it.
> Shouldn't it be just 2 state machine? And if so why the following does not
> work?
>    test1=: {{)n
> 1000ddd
>   2000
> ab3000
>
> 11111xxx
>
>    11
>  22
> }}
>
>    m0=: a.=LF
>
>    s0=: +.".>cutLF {{)n
>   0j0 1j0    NB. when r=0 and c=0 we do nothing, when r=0 and c=1 we do
> nothing but go to row=1
>   0j0 0j2    NB. when r=1 and c=0 we do nothing and go to row=0, when next
> LF (row=1, col=1, we emit word with setting new beginning of new word and
> go to row=0
> }}
>
>    (0;s0;m0;0 0 0 1)    ;:test1
> |index error
> |   (0;s0;m0;0 0 0 1)    ;:test1
>
> So we start with setting current word hence j=0 and we want final column
> d=0 to emit word.
>
> Do you see the shortcoming in the above snippet?
> thanks!
> cheers,
> Pawel
> ----------------------------------------------------------------------
> 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