This gets close, but runs afoul of padding rules:

   10#.1 2 3 4 >:@perm every 4

Anyways, it looks like

   ;1 2 3 4 <@(10 p.~ >:)@perm every 4

might do what you want.

Thanks,

-- 
Raul

On Fri, Jul 17, 2020 at 5:47 PM Skip Cave <[email protected]> wrote:
>
> Is there a more efficient and/or concise way to generate this sequence?
>
> 4 16$>10#.each >: each ({1 perm 4),({2 perm 4),({3 perm 4),({4 perm 4)
>
> 1 2 3 4 12 21 13 31 14 41 23 32 24 42 34 43
>
> 123 132 213 231 312 321 124 142 214 241 412 421 134 143 314 341
>
> 413 431 234 243 324 342 423 432 1234 1243 1324 1342 1423 1432 2134 2143
>
> 2314 2341 2413 2431 3124 3142 3214 3241 3412 3421 4123 4132 4213 4231 4312
> 4321
>
>
> Something like :
>
> 1 2 3 4 each perm 4 NB. I know this doesn't work :-)
>
> Or:
>
> 1 2 3 4 {."1 each perm 4 NB. This doesn't work either :-)
>
> Skip Cave
> Cave Consulting LLC
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to