Op 07-12-17 om 18:27 schreef Jose Mario Quintana:
I really do not know exactly what the original was doing, or what the task
really is, but if the issue was that negative indices are valid for { then
replacing it by (- (_ * 0 > ]))@:[ { ] should do the trick.

kind of, so forcing the index to plus infinite will do the job:

   ((1+0&{::);((+_*0>])@([+{);>:@{`[`]})&>/@}.) ::]^:(_) 0;0;0 _2 0 0
┌─┬─┬────────┐
│3│_│2 _1 0 0│
└─┴─┴────────┘


   Moreover,
counting the jumps in this context seems to be the number of the resulting
items minus one; thus,
no, not for this task. It destroys my J session. So I need a counter.


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

Reply via email to