Here's another thought. 2 3 5 100 table i.7
┌───┬───────────────────────────┐ │ │0 1 2 3 4 5 6 │ ├───┼───────────────────────────┤ │ 2│ 2 3 4 5 6 7 8│ │ 3│ 3 4 5 6 7 8 9│ │ 5│ 5 6 7 8 9 10 11│ │100│100 101 102 103 104 105 106│ └───┴───────────────────────────┘ Try something a little more complex and you find the need to modify what you have done. It's like cleaning. When Tama and I were doing workshops I caller her NS for never satisfied. She would say "but if we just ... couldn't we also.....". Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Saturday, November 19, 2011 4:27 AM To: 'Programming forum' Subject: Re: [Jprogramming] table challenge in simple J I just saw Fraser's post as I was preparing a summary of this challenge. Here are my thoughts: Run the highlights in jijx. Cut out the results. Include the definitions of the main verbs and their tree forms. Add and simple ideas that you noticed along the way. Paste them in a jfile. Name and save the file. Under 'action' choose 'run display. Return to jijx to see your notes with results. a=:2 3 5 b=:0 1 2 3 table=: 13 : '('' '';,.x),.y;x+/y' table 5!:4 <'table' 'c';'d' 'e';'f' ('c';'d'),.'e';'f' a table b Over time the tree form will become more and more easy to follow, and you will begin to write the tacit definitions directly. These little notes will eventually seem so trivial that you can toss them away. Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Alvord Sent: Friday, November 18, 2011 10:16 PM To: 'Programming forum' Subject: Re: [Jprogramming] table challenge in simple J This is the same result as I found. It is almost the same as Fraser Jackson sent from New Zealand, but he had a times rather than a plus sign: Table1=:('' ; [: ,. [) ,. ] ; */ NB. Using a function for more than it was intended can have unexpected results. Kip Murray found such an example and later showed a possible correction to incorporate in your function. I'm working on a new challenge for December. (I'm considering an EST restriction since New Zealand had a decided advantage. The choice of EST is where I live.) Linda -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Markus Schmidt-Gröttrup Sent: Friday, November 18, 2011 1:20 PM To: Programming forum Subject: Re: [Jprogramming] table challenge in simple J table =: ('';[: ,.[) ,.];+/ is that according the rules of "simple J" Am 14.11.2011 02:51, schrieb Linda Alvord: > In the dictionary in the section on "Verbs and Adverbs" there are two > definitions designed to produce a table: > > > > over=:({.;}.)@":@, > > by=:' '&;@,.@[,.] > > a=: 2 3 5 > > b=: 0 1 2 3 > > a by b over a +/ b > > --T-------┐ > > │ │0 1 2 3│ > > +-+-------+ > > │2│2 3 4 5│ > > │3│3 4 5 6│ > > │5│5 6 7 8│ > > L-+-------- > > > > Here is the challenge. Use the arguments a and b and define a single tacit > function in "simple J" that does not use @ and provides the same result. > > > > a table b > > --T-------┐ > │ │0 1 2 3│ > +-+-------+ > │2│2 3 4 5│ > │3│3 4 5 6│ > │4│4 5 6 7│ > L-+-------- > > > > To give a little time for thought, do not post a solution until November > 18th. I'll post mine then too. > > > > Linda > > ---------------------------------------------------------------------- > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
