[Squeak] Newbie permutations

Duane Maxwell dmaxwell at san.rr.com
Tue Apr 9 07:15:18 UTC 2002


> | foo |
> foo := OrderedCollection new.
> #(1 3 5) permutationsDo: [:each | foo add: each].
>
> Does that do it for you?

No, unfortunately this gives:

an OrderedCollection ( #(1 3 5) #(1 3 5) #(1 3 5) #(1 3 5) #(1 3 5) #(1 3
5) )

...which is what probably prompted the question.

-- Duane




More information about the Squeak-dev mailing list