Re: [Jprogramming] how to apply the same adverb repeatedly ?

2023-06-12 Thread Jose Mario Quintana
(3 : '((y`:6) nc)`' ^: 9 +: (`'')) (`:6) 7 23 On Mon, Jun 12, 2023 at 6:57 PM Jose Mario Quintana < jose.mario.quint...@gmail.com> wrote: > Concisely, > >ncver=. 3 : '((y`:6) nc)`' >(ncver ^: 9 +: (`'')) (`:6) 7 > 23 > > > > > On Mon, Jun 12, 2023 at 6:46 PM Jose Mario Quinta

Re: [Jprogramming] how to apply the same adverb repeatedly ?

2023-06-12 Thread Jose Mario Quintana
Concisely, ncver=. 3 : '((y`:6) nc)`' (ncver ^: 9 +: (`'')) (`:6) 7 23 On Mon, Jun 12, 2023 at 6:46 PM Jose Mario Quintana < jose.mario.quint...@gmail.com> wrote: > An alternative way is verbing, so to speak, the (nc) adverb taking and > producing instead the gerunds corresponding t

Re: [Jprogramming] how to apply the same adverb repeatedly ?

2023-06-12 Thread Jose Mario Quintana
An alternative way is verbing, so to speak, the (nc) adverb taking and producing instead the gerunds corresponding to the verbs, powering the verbed adverb (ncver) and converting the resulting gerund back to the desired verb (extra parentheses and spaces for clarity), ncver=. 3 : 0 u=. (y`:6)

Re: [Jprogramming] Rotating rows

2023-06-12 Thread 'Skip Cave' via Programming
Rob, Rotate by row/column was exactly what I needed, thanks! Tony, Wow! I didn't know that catalog worked like that! Thanks! Skip Skip Cave Cave Consulting LLC On Mon, Jun 12, 2023 at 2:53 AM 'Rob Hodgkinson' via Programming < programm...@jsoftware.com> wrote: > See dyadic rotate ( > https:/

Re: [Jprogramming] Rotating rows

2023-06-12 Thread Tony Poole
And how using Catalogue to generating s1: s1 =. {'ABCD';'1234' On Mon, Jun 12, 2023 at 3:53 AM 'Rob Hodgkinson' via Programming < programm...@jsoftware.com> wrote: > See dyadic rotate ( > https://code.jsoftware.com/wiki/Vocabulary/bardot#dyadic) > > APL had rotate on either first or last axis,

Re: [Jprogramming] how to apply the same adverb repeatedly ?

2023-06-12 Thread Raul Miller
Note that nc is typically defined as 4!:0 so redefining it might break some code. That said: nc=. 1 : '[: >: u' mnc=: {{ (`(m#<'nc'))(`:6) }} + 9 mnc 7 16 + 9 mnc [: >: [: >: [: >: [: >: [: >: [: >: [: >: [: >: [: >: + 9 mnc (`(nc`nc`nc`nc`nc`nc`nc`nc`nc))(`:6) I hope this makes s

[Jprogramming] how to apply the same adverb repeatedly ?

2023-06-12 Thread Martin Kreuzer
Dear all - Having used Fixed Power (u^:n y) before, I noticed that it works on the verb-adverb compound to its left. Let's have a simple, silly example: nc=. 1 : '[: >: u' NB. defining an adverb 'increase' +: i. nc 7 NB. which works fine 2 4 6 8 10 12 14 Using Fixed Power like

Re: [Jprogramming] Rotating rows

2023-06-12 Thread 'Rob Hodgkinson' via Programming
See dyadic rotate (https://code.jsoftware.com/wiki/Vocabulary/bardot#dyadic) APL had rotate on either first or last axis, and J has rotate that can be ‘adapted’ to do what you want using rank: ]s1=.4 4${(4#'ABCD'),.(-.&' ')":4#1234 ┌──┬──┬──┬──┐ │A1│A2│A3│A4│ ├──┼──┼──┼──┤ │B1│B2│B3│B4│ ├──┼─

[Jprogramming] Rotating rows

2023-06-12 Thread 'Skip Cave' via Programming
I can generate a 4x4 square with unique identifiers in each square: ]s1=.4 4${(4#'ABCD'),.(-.&' ')":4#1234 ┌──┬──┬──┬──┐ │A1│A2│A3│A4│ ├──┼──┼──┼──┤ │B1│B2│B3│B4│ ├──┼──┼──┼──┤ │C1│C2│C3│C4│ ├──┼──┼──┼──┤ │D1│D2│D3│D4│ └──┴──┴──┴──┘ How can I rotate each row a different amount? I want t