April 28, 2015
7:34 p.m.
Hi michal Thanks! Stef Le 28/4/15 21:07, Michal Balda a écrit :
Hi, this solution is not exactly beautiful, but it works:
| input output |
input := #(1 2 3).
output := Array streamContents: [ :stream | 1 to: input size do: [ :take | input combinations: take atATimeDo: [ :combination | stream nextPut: combination copy ] ] ].
output inspect
Michal
On 28.4.2015 20:02, stepharo wrote:
Hi
I'm looking for a method that given #(1 2 3) returns #( #(1) #(2) #(3) #(1 2) #(2 3) #(1 3) #( 1 2 3))
Stef