Now ranks is a verb.
A=:'ABCDEFFGHIJKLMNOPSSTUVXYZ'
ranks=: 13 :'(((<B);<<"(C)B),:(<''noun rank''),<''verb 
rank''),(#$B);<C=.?>:#$B=:(?4 5 6)$y'
      
   ranks A 
┌─────────┬─────────┐
│┌┐       │┌┐       │
│││       │││       │
│││       │││       │
│││       │││       │
│││       │││       │
│││       │││       │
│└┘       │└┘       │
├─────────┼─────────┤
│noun rank│verb rank│
├─────────┼─────────┤
│3        │3        │
└─────────┴─────────┘
   $B
2 2 0
   
   
   
   ranks A
┌─────────┬─────────┐
│┌───┐    │         │
│└───┘    │         │
├─────────┼─────────┤
│noun rank│verb rank│
├─────────┼─────────┤
│3        │1        │
└─────────┴─────────┘
   $B
0 3 3   

    ranks A
┌─────────┬─────────────┐
│┌─────┐  │┌─────┬─────┐│
││ABCDE│  ││ABCDE│FFGHI││
││FFGHI│  │├─────┼─────┤│
││     │  ││JKLMN│OPSST││
││JKLMN│  │└─────┴─────┘│
││OPSST│  │             │
│└─────┘  │             │
├─────────┼─────────────┤
│noun rank│verb rank    │
├─────────┼─────────────┤
│3        │1            │
└─────────┴─────────────┘
   $B
2 2 5
   Try the 4th deimension with  B=:4 5 6 7

Can you define a verb to  run rank A  n times?

Linda

-----Original Message-----
From: Programming <programming-boun...@forums.jsoftware.com> On Behalf Of Linda 
Alvord
Sent: Tuesday, September 25, 2018 10:37 PM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Using rank to avoid looping - reference?

I think the problelems are worked out.

NB. Random rank noun B
   NB. and dom rank verb b ox
     A=:'ABCDEFFGHIJKLMNOPSSTUVXYZ'
   
   
    B=:(>:?(?4)#4)$A
   D=:<"(C=:?>:#$B)B
   (((<B);<D),:(<'noun rank'),<'verb rank'),(#$B);<C 
┌─────────┬─────────────────────┐
│┌────┐   │┌────┬────┬────┬────┐│
││ABCD│   ││ABCD│EFFG│HIJK│LMNO││
││EFFG│   │├────┼────┼────┼────┤│
││HIJK│   ││PSST│UVXY│ZABC│DEFF││
││LMNO│   │├────┼────┼────┼────┤│
││    │   ││GHIJ│KLMN│OPSS│TUVX││
││PSST│   │└────┴────┴────┴────┘│
││UVXY│   │                     │
││ZABC│   │                     │
││DEFF│   │                     │
││    │   │                     │
││GHIJ│   │                     │
││KLMN│   │                     │
││OPSS│   │                     │
││TUVX│   │                     │
│└────┘   │                     │
├─────────┼─────────────────────┤
│noun rank│verb rank            │
├─────────┼─────────────────────┤
│3        │1                    │
└─────────┴─────────────────────┘
   
   $B
3 4 4
 
Here's anotherer result.

┌─────────┬─────────┐
│┌───┐    │┌─┬─┬─┐  │
││ABC│    ││A│B│C│  │
││DEF│    │├─┼─┼─┤  │
││FGH│    ││D│E│F│  │
│└───┘    │├─┼─┼─┤  │
│         ││F│G│H│  │
│         │└─┴─┴─┘  │
├─────────┼─────────┤
│noun rank│verb rank│
├─────────┼─────────┤
│2        │0        │
└─────────┴─────────┘
   
   $B
3 3
 
  
Linda

   
-----Original Message-----
From: Programming <programming-boun...@forums.jsoftware.com> On Behalf Of Linda 
Alvord
Sent: Sunday, September 23, 2018 8:43 PM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Using rank to avoid looping - reference?

Why not include these?

 #$F=:' '
0

   #$G=:'A'
0
   <"0 F
┌─┐
│ │
└─┘

   <"0 G
┌─┐
│A│
└─┘
  Maybe A=:' ABC...

But that might be messy.

Linda
Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------
From: David Lambert <b49p23t...@gmail.com>
Date: 9/23/18 7:55 PM (GMT-05:00)
To: programming <programm...@jsoftware.com>
Subject: Re: [Jprogramming] Using rank to avoid looping - reference?

err, yes and

rank =: # @: $

DATA =: 'ABCDEFFGHIJKLMNOPSSTUVXYZ'
SHAPE =: >: ? 3 # 5   NB. zeros aren't beneficial to this demonstration
A =: SHAPE $ DATA     NB. A is a rank 3 array of random shape
ITEM_RANK =: ? >: rank A
(;:'array items') , ( (< A) ; ( < <"ITEM_RANK A) ) , ( SHAPE ; ITEM_RANK )



On 09/23/2018 07:19 PM, David Lambert wrote:
>
> DATA =: 'ABCDEFFGHIJKLMNOPSSTUVXYZ'
> SHAPE =: >: ? 3 # 5   NB. zeros aren't beneficial to this demonstration
> A =: SHAPE $ DATA     NB. A is a rank 3 array of random shape
> ITEM_RANK =: ? >: rank A
> (;:'array items') , ( (< A) ; ( < <"ITEM_RANK A) ) , ( SHAPE ; 
> ITEM_RANK )
>
>

----------------------------------------------------------------------
For information about J forums see 
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C589697f1704b4179c58508d62358e9fd%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636735262118886073&amp;sdata=XZIf%2Fevhnh9fRFpnM%2ByC2oNq2uO2rxtz%2BhmQRkwpMWk%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see 
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C589697f1704b4179c58508d62358e9fd%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636735262118886073&amp;sdata=XZIf%2Fevhnh9fRFpnM%2ByC2oNq2uO2rxtz%2BhmQRkwpMWk%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see 
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C589697f1704b4179c58508d62358e9fd%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636735262118886073&amp;sdata=XZIf%2Fevhnh9fRFpnM%2ByC2oNq2uO2rxtz%2BhmQRkwpMWk%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to