[squeak-dev] Ulam spiral
Chris Cunnington
smalltalktelevision at gmail.com
Mon Oct 1 16:30:49 UTC 2012
On 12-10-01 11:55 AM, Bert Freudenberg wrote:
> Display restoreAfter: [
> size := 400 squared.
> primes := (Integer primesUpTo: size) asSet.
> step := 1.
> length := 1.
> pen := Pen new turn: 90.
> [step < size] whileTrue: [
> 2 timesRepeat: [
> length timesRepeat: [
> pen fillColor: ((primes includes: step)
> ifTrue: [Color black]
> ifFalse: [Color white]).
> pen go: 1.
> step := step + 1].
> pen turn: -90].
> length := length + 1]].
I like that a lot. I found myself executing it over and over.
Chris
More information about the Squeak-dev
mailing list
|