Look at the verb 'comb' in http://www.jsoftware.com/jwiki/Essays/Combinations
Henry Rich On 8/20/2011 4:20 PM, Alex Giannakopoulos wrote: > Many thanks to everyone who replied! > I never cease to be amazed by the depth and breadth of answers on this list. > I really liked (-:~.) rather than my own */@~: > > Why didn't I think of it? Once a good answer is shown it feels like I've > had it mastered it forever.... Unusual but effective way of learning J. > > > A little further question: > > What would be a good way of listing the combinations (in the sense of nCr) > from a rank-1 array? > IOW, something like > > 2 comb 6 7 8 > 6 7 > 6 8 > 7 8 > > obviously the answer would be unsorted, though following the j conventions I > have seen in "permutations", the original order could be kept as given in > the example above. > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
