[Jprogramming] Array Coordinates
'Mike Day' via Programming
programming at jsoftware.com
Fri Nov 30 22:29:46 UTC 2018
That’s the one I always use, too,
Mike
Please reply to mike_liz.day at tiscali.co.uk.
Sent from my iPad
> On 30 Nov 2018, at 19:31, Raul Miller <rauldmiller at gmail.com> wrote:
>> Or, slightly longer:
> ($a)#:I.,a
> or
> ($#:I.@,)a
>> ...
>> Thanks,
>> --
> Raul
>>> On Fri, Nov 30, 2018 at 2:04 PM Don Guinn <donguinn at gmail.com> wrote:
>>>> Or do
>>>> 4 $.$.a
>>>>> On Fri, Nov 30, 2018, 11:56 AM Roger Hui <rogerhui.canada at gmail.com wrote:
>>>>>> a #&, {i.&.>$a
>>> ┌───┬───┬───┬───┬───┐
>>> │0 0│2 3│4 6│6 9│9 2│
>>> └───┴───┴───┴───┴───┘
>>>> a #&, {i.&.>$a
>>> 0 0
>>> 2 3
>>> 4 6
>>> 6 9
>>> 9 2
>>>>>>>>>>>> On Fri, Nov 30, 2018 at 10:52 AM Skip Cave <skip at caveconsulting.com>
>>> wrote:
>>>>>>> Given the array a:
>>>>>>>> ]a=.10 100ドル=23|i.100
>>>>>>>> 1 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 0 1 0 0 0 0 0 0
>>>>>>>> 0 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 0 0 0 0 1 0 0 0
>>>>>>>> 0 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 0 0 0 0 0 0 0 1
>>>>>>>> 0 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 0 0 0 0 0 0 0 0
>>>>>>>> 0 0 1 0 0 0 0 0 0 0
>>>>>>>>>>>> How can I write a function 'ac' that will list the coordinates of each 1
>>> in
>>>> the array?
>>>>>>>> Example using array a:
>>>>>>>> ac a
>>>>>>>> 0 0
>>>>>>>> 2 3
>>>>>>>> 4 6
>>>>>>>> 6 9
>>>>>>>> 9 3
>>>>>>>> Extend to 3 or more dimensions?
>>>>>>>> Skip Cave
>>>> ----------------------------------------------------------------------
>>>> 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
More information about the Programming
mailing list