| Class | Integer |
| In: |
combinations.rb
permutations.rb |
| Parent: | Object |
Yield a sequence of combinations taken k at a time from the numbers (0..n-1) where n is self. Returns the number of such combinations. Returns nil if the parameter or self value are out of range.
# File combinations.rb, line 100 def combinations(k) c = Combinations.new(self, k) if block_given? c.each { |a| yield a} else c.each end end