Brian Schott wrote:
> 1 A. b transposes the last two items of b
A. is really cool. The problem with using it is coming up with the correct
left-hand argument (code) for the permutation you want. A few special ones
are easy to remember (particularly 0 for "do nothing", _1 for "reverse",
and 1 for "swap")*, but outside of these, the codes are quite obscure.
The most straightforward method for identifying the anagram code you want
is by creating the desired permutation vector manually, then applying the
*monad* A. to it, and using the resulting output as a LHA to the dyad A.
against your real argument later.
The real high road would be to study and understand the model of A. Roger
provided [1], but that's been on my to-do list for just about a decade.
Don't have much hope it'll get done in the next one, either (though I find
the /:^:2@:,/ for "direct cycle representation from anagram code" part
intriguing!).
-Dan
* One example that sticks in my mind of where these special anagram codes
came in quite handy was the "zig zag matrix" puzzle. I once wrote up an
explanation of it (including the A. parts) on RosettaCode:
http://rosettacode.org/wiki/Talk:Zig-zag_matrix#anti-diagonals
[1] Roger's model of A., including the interpretation and calculation of
"anagram codes" (i.e. the results of monad A., and the LHA to dyad A.):
http://www.jsoftware.com/pipermail/general/1999-September/002352.html
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm