A really quick hack at the problem gave me this
sper=:>@(#~(-: ~.)@>)@,@{@($ <@i.)
3 sper 4
0 1 2
0 1 3
0 2 1
0 2 3
0 3 1
0 3 2
1 0 2
1 0 3
1 2 0
1 2 3
1 3 0
1 3 2
2 0 1
2 0 3
2 1 0
2 1 3
2 3 0
2 3 1
3 0 1
3 0 2
3 1 0
3 1 2
3 2 0
3 2 1
2 sper 4
0 1
0 2
0 3
1 0
1 2
1 3
2 0
2 1
2 3
3 0
3 1
3 2
1 sper 4
0
1
2
3
Cheers, bob
> On Nov 19, 2017, at 11:49 PM, 'Skip Cave' via Programming
> <[email protected]> wrote:
>
> How to find the permutations of y objects taken x at a time?
>
> 3 sper 4
>
> 0 1 2
>
> 0 1 3
>
> 0 2 1
>
> 0 2 3
>
> 0 3 1
>
> 0 3 2
>
> 1 0 2
>
> 1 0 3
>
> 1 2 0
>
> 1 2 3
>
> 1 3 0
>
> 1 3 2
>
> 2 0 1
>
> 2 0 3
>
> 2 1 0
>
> 2 1 3
>
> 2 3 0
>
> 2 3 1
>
> 3 0 1
>
> 3 0 2
>
> 3 1 0
>
> 3 1 2
>
> 3 2 0
>
> 3 2 1
>
>
> 2 sper 4
>
> 0 1
>
> 0 2
>
> 0 3
>
> 1 0
>
> 1 2
>
> 1 3
>
> 2 0
>
> 2 1
>
> 2 3
>
> 3 0
>
> 3 1
>
> 3 2
>
> 1 sper 4
> 0
> 1
> 2
> 3
>
> Skip
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm