4件ヒット
[1-4件を表示]
(0.452秒)
ライブラリ
- ビルトイン (4)
検索結果
先頭4件
-
Array
# repeated _ combination(n) -> Enumerator (54436.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}
@see Array#repeated_permutation, Array#combination... -
Array
# repeated _ combination(n) { |c| . . . } -> self (54436.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}
@see Array#repeated_permutation, Array#combination... -
Array
# repeated _ permutation(n) -> Enumerator (54418.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...ロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}
@see Array#repeated_combination, Array#permutation... -
Array
# repeated _ permutation(n) { |p| . . . } -> self (54418.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...ロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}
@see Array#repeated_combination, Array#permutation...