R.E.,
I've found { kind or useful for working with amend,
but keeping the array structure intact (maybe helpful for amend in-place?)
For example:
indexes =. , @ { @: (i.each) @ $
] a =: 5 9 $ '-'
---------
---------
---------
---------
---------
] b =: ? ($a) $ 2
1 1 1 0 0 1 1 1 0
1 1 0 0 0 1 1 0 0
0 0 0 1 0 0 1 0 0
1 0 1 1 1 0 0 1 1
1 1 0 1 0 1 1 1 1
] a =: '*' ( (,b) # indexes a ) } a
***--***-
**---**--
---*--*--
*-***--**
**-*-****
-----Original Message-----
Message: 3
Date: Thu, 20 Jul 2006 10:29:47 +0200
From: "R.E. Boss" <[EMAIL PROTECTED]>
Subject: RE: [Jprogramming] RE: }
To: 'Programming forum' <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
Brilliant! Especially for a first contribution, AFAICS.
It deserves a place in documentation and books.
That is why J attracts me: an elegant solution is almost always possible.
R.E. Boss
-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Brewer, Andrew
Verzonden: woensdag 19 juli 2006 20:19
Aan: [email protected]
Onderwerp: [Jprogramming] RE: }
This seems interesting:
'*' (({1;2 3),{0;7) } 2 9$'-'
-------*-
--**-----
-Andrew
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm