Rank is an attribute. As an attribute of nouns, rank is tally-of-shape. As an attribute of verbs, it is the rank of the cell to which the verb applies.
Those terse assertions are not immediately understood, we expect. Like J programs, they can be examined over time, and perhaps corrected. Chapter 6 of _J for C Programmers_ is the text I recommend most highly for getting a grip on verb rank. Noun rank will be understood in the natural course of learning verb rank. --Tracy 2011/11/23 Linda Alvord <[email protected]> > But are these ranks? This the same result that I get with the original > expression you used? > > Linda > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Kip Murray > Sent: Tuesday, November 22, 2011 11:28 PM > To: Programming forum > Subject: Re: [Jprogramming] 21 November ranks challenge in Simple J > > NB. Explain behavior of > > r =: [: |. 3 $ |. > > NB. Compare steps for r 0 1 with steps for r i. 2 3 4 . > > NB. First > > r 0 1 > 1 0 1 > > NB. What happens is > > |. 0 1 NB. Reverse 0 1 > 1 0 > 3 $ 1 0 NB. Select from 1 0 1 0 1 0 ... until 3 have been chosen > 1 0 1 > |: 1 0 1 NB. Reverse 1 0 1 > 1 0 1 > > NB. Now look at > > i. 2 3 4 NB. Items are two 3 by 4 arrays, think array0 and array1 > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > NB. When we do r i. 2 3 4 what happens is > > |. i. 2 3 4 NB. Reverse the two arrays > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > 3 $ |. i. 2 3 4 NB. Select 3 from array1 array 0 array 1 array 0 ... > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > |. 3 $ |. i. 2 3 4 NB. reverse the selected arrays > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > NB. Thus, > > r i. 2 3 4 > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > > 12 13 14 15 > 16 17 18 19 > 20 21 22 23 > > > On 11/22/2011 8:54 PM, Linda Alvord wrote: > > Here's a simple translation, but both it and the original have the same > > peculiarities. > > > > ranks =: 3 : '3$&.|.y' > > ranks > > 3 : '3$&.|.y' > > > > ranks2 =: 13 : '3$&.|.y' > > ranks2 > > 3 $&.|. ] > > > > r=: 13 :'|.(|. 3) $|.y' > > r > > [: |. 3 $ |. > > > > 5!:4<'ranks' > > -- 3 > > - : -+- ,:'3$&.|.y' > > > > 5!:4<'ranks2' > > -- 3 > > │ -- $ > > --+-&. -+- |. > > L- ] > > > > 5!:4<'r' > > -- [: > > +- |. > > --+ -- 3 > > L----+- $ > > L- |. > > > > ranks 2 > > 2 2 2 > > ranks 2 3 > > 3 2 3 > > ranks i.2 3 4 > > 12 13 14 15 > > 16 17 18 19 > > 20 21 22 23 > > > > 0 1 2 3 > > 4 5 6 7 > > 8 9 10 11 > > > > 12 13 14 15 > > 16 17 18 19 > > 20 21 22 23 > > > > > > > > r 2 > > 2 2 2 > > r 2 3 > > 3 2 3 > > r i.2 3 4 > > 12 13 14 15 > > 16 17 18 19 > > 20 21 22 23 > > > > 0 1 2 3 > > 4 5 6 7 > > 8 9 10 11 > > > > 12 13 14 15 > > 16 17 18 19 > > 20 21 22 23 > > > > I have't followed some of the later ways to find rank. My question is > what > > happened here. It seemed like a simple J expression. > > > > Thanks > > > > Linda > > > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Kip Murray > > Sent: Monday, November 21, 2011 6:40 AM > > To: Programming forum > > Subject: Re: [Jprogramming] 21 November ranks challenge in Simple J > > > > It is 21 November, solutions are welcome. > > > > On 11/18/2011 11:33 AM, Kip Murray wrote: > >> Please wait until Monday 21 November to post solutions. > >> > >> From the Rank u"n page in the Vocabulary: > >> > >> The verb u"n applies u to each cell as specified by the rank n . The > >> full form of the rank used is 3$&.|.n . For example, if n=:2 , the three > >> ranks are 2 2 2 , and if n=: 2 3, they are 3 2 3 . > >> > >> The challenge: rewrite verb > >> > >> ranks =: 3 : '3$&.|.y' > >> > >> using a train with no conjunctions. > >> > >> ranks 2 > >> 2 2 2 > >> ranks 2 3 > >> 3 2 3 > >> > >> ---------------------------------------------------------------------- > >> 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 > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
