Let’s pretend that 10?10 was a placeholder rather than your desired
operation.  Let’s also pretend that your desired operation doesn’t support
something like 10 10 10 10?10

Typically we would want to use rank (") to solve this problem, but let’s
pretend we have carefully thought about this, and that ^: solves some
problem for us that rank doesn’t address.

Also, let’s pretend that you not only want to perform the operation 4
times, but that you also want to collect all four results.

In this context, you need a verb that does 10?10. Let’s use

V=: 10&?bind 10

With that in mind, we might try

   (,. V)^:4 i.10 0

But... there’s a slight chance that that wouldn’t execute 10?10 four
times.  So, instead, we could use:

   V^:1 2 3 4 ''

Not sure if any of this was relevant to your intent, though...

Thanks,

—
Raul

On Tuesday, April 16, 2019, 'Skip Cave' via Programming <
[email protected]> wrote:

> How can I use the power primitive ^: to execute 10?10 four times?
> I want something like this:
>
> (10?10)^: 4
>
> 8 0 9 6 5 7 4 3 1 2
>
> 5 3 1 8 0 9 7 6 2 4
>
> 1 4 6 0 2 5 8 9 3 7
>
> 1 9 7 2 0 8 3 4 5 6
>
>
>
> 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

Reply via email to