Paul Moore asked:
> Is there a way of writing this where I can abstract (5?3#52)
>  out, and only write it once?

Sure.  How do you like:

           ,/ 5 ? 2 $ ,: 3 # 52
        18  2 44 41 33
        38 41  6 45 15
        48  5 10  1 49
        36  7 13  5 38
         8 11 25 34  2
         1  4 11 10 42

The key here is the  $:,:  .  That's basically the  sets_of  verb you're 
seeking.  The ultimate  ,/  assembles all the sets into one large result. I 
recommend you do your processing before the  ,/  e.g. :

           ,/ process"_1 ] 5 ? 2 $ ,: 3 # 52

for the sake of parsimony (assuming the outputs of your process are smaller 
than its inputs).

-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to