Both over and by are verbs.
4!:0 'a';'b';'over';'by';'table'
0 0 3 3 3
The final table is also a verb:
table=: 13 : '('' '';,.x),.y;x+/y'
table
(' ' ; [: ,. [) ,. ] ; +/
a table b
--T-------┐
│ │0 1 2 3│
+-+-------+
│2│2 3 4 5│
│3│3 4 5 6│
│5│5 6 7 8│
L-+--------
When I enter your entire sentence I get a strange result I've never seen
before.
It erases the line. Then splits it. The result is almost correct. Maybe
some of the real experts can explain this behavior.
2 3 5 +(1 : '[
by ] over [ u/ ]') 0 1 2 3
--T-------┐
│ │0 1 2 3│
+-+-------+
│2│0 1 2 3│
│3│1 2 3 4│
│5│2 3 4 5│
│ │3 4 5 6│
L-+--------
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Brian Schott
Sent: Saturday, November 19, 2011 11:02 AM
To: Programming forum
Subject: Re: [Jprogramming] table challenge in simple J
Could the adverb part be done this way? If so, the verb part could be
changed, too.
2 3 5 +(1 : '[ by ] over [ u/ ]') 0 1 2 3
+-+-------+
| |0 1 2 3|
+-+-------+
|2|2 3 4 5|
|3|3 4 5 6|
|5|5 6 7 8|
+-+-------+
n
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm