[Newbies] crossSum, an alternative implementation

Ron Teitelbaum Ron at USMedRec.com
Wed May 10 11:55:24 UTC 2006


Markus,

That is beautiful!  I started to do something similar but was trying to
increase the size of the mod and it was dependent on the number of digits so
I had to do a string conversion anyway.  You did a very nice job!

Ron

> -----Original Message-----
> From: beginners-bounces at lists.squeakfoundation.org [mailto:beginners-
> bounces at lists.squeakfoundation.org] On Behalf Of Markus Gaelli
> Sent: Tuesday, May 09, 2006 6:44 PM
> To: beginners at lists.squeakfoundation.org
> Subject: [Newbies] crossSum, an alternative implementation
> 
> Hi all,
> 
> I just subscribed to the list and found that crossSum debate in the
> archives.
> I did an implementation a while ago for musinum, a fractal music
> generator, that can be found on squeakmap.
> (for a "professional implementation see also http://reglos.de/musinum )
> 
> I did it this way:
> 
> Integer >> crossSumBase: aBase
> 	self < aBase
> 		ifTrue: [^ self].
> 	^ self \\ aBase
> 		+ (self // aBase crossSumBase: aBase)
> 
> Cheers,
> 
> Markus
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners




More information about the Beginners mailing list