On 8/6/20, 'robert therriault' via Programming <[email protected]> wrote: Hi, Bob!
> Pascal got you most of the way there, but I will add the idea of using a > selector to the Amend adverb to provide more precision. Where can I find more info on using a selector with Amend? > [ t=: <"0 i. 2 3 4 NB. creates rank three boxed brick Actually, when I spoke of three parts to the address of a box, your "t" was one of the parts I meant. That leaves just 2 address parts for row and column. In other words, would you please address the case of a 2-rank boxed brick? (that is, t=: <"0 i. 3 4 ) > ┌──┬──┬──┬──┐ > │0 │1 │2 │3 │ > ├──┼──┼──┼──┤ > │4 │5 │6 │7 │ > ├──┼──┼──┼──┤ > │8 │9 │10│11│ > └──┴──┴──┴──┘ > [ rep=: <'a' NB. replacement value for selected addresses > ┌─┐ > │a│ > └─┘ Your examples showed changing both an entire area and an entire row to the same value. But, using the above, how would you change ONLY the box located at row 1, column 2? Would it be rep (( < 1 2) }) t ? I tried this, and it *did* work! BUT..... If row=. 1 and col=. 2, then rep (( < row col) }) t fails with a syntax error--why? I have to be able to reassign values on the fly rather than use once-only fixed values. Looking forward to your reply! Harvey ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
