I guess its just something like this :-

|c|
c := #(1 2 3 6 7 2 4 6 12 14 3 6 9 18 21 4 8 12 24 28 5 10 15 32 35).
c do: [:x | c do: [:y | Transcript show: '('; show: x; show: '-'; show: y;show:')']].

On Tue, Jan 5, 2010 at 21:34, John Toohey <jt@parspro.com> wrote:
:-)

I don't suppose you have an equally elegant solution to the scores for a NFL game, where the units can be 1,2,3,6, assuming that each team could score a total of say, 35 points.��


On Tue, Jan 5, 2010 at 21:26, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>> "John" == John Toohey <jt@parspro.com> writes:

John> Thank you, duly chastened. I did know the formulae for P and C, but didn't
John> know how to add the repetitions. My original code was :-
John> |c|
John> c := SortedCollection new.
John> c add: '0, 0'; add:'1, 1'; add: '2, 2'; add:'3, 3'; add: '4, 4'.
John> (0 to: 4) combinations: 2 atATimeDo:[:each | c add: each asCommaString. ��c
John> add:( each reverse) asCommaString].

"Every time I cut with this wide saw, it removes 1/2 inch from the wood!
I'll just glue it back after the cuts!"

"why don't you just use the laser cutter? ��no losses!"

:-)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
-JT





--
-JT